Skip to content

Commit a00be52

Browse files
authored
Initial commit
0 parents  commit a00be52

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+39275
-0
lines changed

.devcontainer/devcontainer.json

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "GitHub Actions (TypeScript)",
3+
"image": "mcr.microsoft.com/devcontainers/typescript-node:20",
4+
"postCreateCommand": "npm install",
5+
"customizations": {
6+
"codespaces": {
7+
"openFiles": ["README.md"]
8+
},
9+
"vscode": {
10+
"extensions": [
11+
"bierner.markdown-preview-github-styles",
12+
"davidanson.vscode-markdownlint",
13+
"dbaeumer.vscode-eslint",
14+
"esbenp.prettier-vscode",
15+
"github.copilot",
16+
"github.copilot-chat",
17+
"github.vscode-github-actions",
18+
"github.vscode-pull-request-github",
19+
"me-dutour-mathieu.vscode-github-actions",
20+
"redhat.vscode-yaml",
21+
"rvest.vs-code-prettier-eslint",
22+
"yzhang.markdown-all-in-one"
23+
],
24+
"settings": {
25+
"editor.defaultFormatter": "esbenp.prettier-vscode",
26+
"editor.tabSize": 2,
27+
"editor.formatOnSave": true,
28+
"markdown.extension.list.indentationSize": "adaptive",
29+
"markdown.extension.italic.indicator": "_",
30+
"markdown.extension.orderedList.marker": "one"
31+
}
32+
}
33+
},
34+
"remoteEnv": {
35+
"GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}"
36+
},
37+
"features": {
38+
"ghcr.io/devcontainers/features/github-cli:1": {},
39+
"ghcr.io/devcontainers-contrib/features/prettier:1": {}
40+
}
41+
}

.env.example

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# dotenv-linter:off IncorrectDelimiter
2+
3+
# Do not commit your actual .env file to Git! This may contain secrets or other
4+
# private information.
5+
6+
# Enable/disable step debug logging (default: `false`). For local debugging, it
7+
# may be useful to set it to `true`.
8+
ACTIONS_STEP_DEBUG=true
9+
10+
# GitHub Actions inputs should follow `INPUT_<name>` format (case-sensitive).
11+
# Hyphens should not be converted to underscores!
12+
INPUT_MILLISECONDS=2400
13+
14+
# GitHub Actions default environment variables. These are set for every run of a
15+
# workflow and can be used in your actions. Setting the value here will override
16+
# any value set by the local-action tool.
17+
# https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
18+
19+
# CI="true"
20+
# GITHUB_ACTION=""
21+
# GITHUB_ACTION_PATH=""
22+
# GITHUB_ACTION_REPOSITORY=""
23+
# GITHUB_ACTIONS=""
24+
# GITHUB_ACTOR=""
25+
# GITHUB_ACTOR_ID=""
26+
# GITHUB_API_URL=""
27+
# GITHUB_BASE_REF=""
28+
# GITHUB_ENV=""
29+
# GITHUB_EVENT_NAME=""
30+
# GITHUB_EVENT_PATH=""
31+
# GITHUB_GRAPHQL_URL=""
32+
# GITHUB_HEAD_REF=""
33+
# GITHUB_JOB=""
34+
# GITHUB_OUTPUT=""
35+
# GITHUB_PATH=""
36+
# GITHUB_REF=""
37+
# GITHUB_REF_NAME=""
38+
# GITHUB_REF_PROTECTED=""
39+
# GITHUB_REF_TYPE=""
40+
# GITHUB_REPOSITORY=""
41+
# GITHUB_REPOSITORY_ID=""
42+
# GITHUB_REPOSITORY_OWNER=""
43+
# GITHUB_REPOSITORY_OWNER_ID=""
44+
# GITHUB_RETENTION_DAYS=""
45+
# GITHUB_RUN_ATTEMPT=""
46+
# GITHUB_RUN_ID=""
47+
# GITHUB_RUN_NUMBER=""
48+
# GITHUB_SERVER_URL=""
49+
# GITHUB_SHA=""
50+
# GITHUB_STEP_SUMMARY=""
51+
# GITHUB_TRIGGERING_ACTOR=""
52+
# GITHUB_WORKFLOW=""
53+
# GITHUB_WORKFLOW_REF=""
54+
# GITHUB_WORKFLOW_SHA=""
55+
# GITHUB_WORKSPACE=""
56+
# RUNNER_ARCH=""
57+
# RUNNER_DEBUG=""
58+
# RUNNER_NAME=""
59+
# RUNNER_OS=""
60+
# RUNNER_TEMP=""
61+
# RUNNER_TOOL_CACHE=""

.gitattributes

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto eol=lf
2+
3+
dist/** -diff linguist-generated=true

.github/dependabot.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
groups:
8+
actions-minor:
9+
update-types:
10+
- minor
11+
- patch
12+
13+
- package-ecosystem: npm
14+
directory: /
15+
schedule:
16+
interval: weekly
17+
ignore:
18+
- dependency-name: '@types/node'
19+
update-types:
20+
- 'version-update:semver-major'
21+
groups:
22+
npm-development:
23+
dependency-type: development
24+
update-types:
25+
- minor
26+
- patch
27+
npm-production:
28+
dependency-type: production
29+
update-types:
30+
- patch

.github/workflows/check-dist.yml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# In TypeScript actions, `dist/` is a special directory. When you reference
2+
# an action with the `uses:` property, `dist/index.js` is the code that will be
3+
# run. For this project, the `dist/index.js` file is transpiled from other
4+
# source files. This workflow ensures the `dist/` directory contains the
5+
# expected transpiled code.
6+
#
7+
# If this workflow is run from a feature branch, it will act as an additional CI
8+
# check and fail if the checked-in `dist/` directory does not match what is
9+
# expected from the build.
10+
name: Check Transpiled JavaScript
11+
12+
on:
13+
pull_request:
14+
branches:
15+
- main
16+
push:
17+
branches:
18+
- main
19+
20+
permissions:
21+
contents: read
22+
23+
jobs:
24+
check-dist:
25+
name: Check dist/
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- name: Checkout
30+
id: checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Setup Node.js
34+
id: setup-node
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version-file: .node-version
38+
cache: npm
39+
40+
- name: Install Dependencies
41+
id: install
42+
run: npm ci
43+
44+
- name: Build dist/ Directory
45+
id: build
46+
run: npm run bundle
47+
48+
# This will fail the workflow if the `dist/` directory is different than
49+
# expected.
50+
- name: Compare Directories
51+
id: diff
52+
run: |
53+
if [ ! -d dist/ ]; then
54+
echo "Expected dist/ directory does not exist. See status below:"
55+
ls -la ./
56+
exit 1
57+
fi
58+
if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then
59+
echo "Detected uncommitted changes after build. See status below:"
60+
git diff --ignore-space-at-eol --text dist/
61+
exit 1
62+
fi
63+
64+
# If `dist/` was different than expected, upload the expected version as a
65+
# workflow artifact.
66+
- if: ${{ failure() && steps.diff.outcome == 'failure' }}
67+
name: Upload Artifact
68+
id: upload
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: dist
72+
path: dist/

.github/workflows/ci.yml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Continuous Integration
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
test-typescript:
16+
name: TypeScript Tests
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
id: checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node.js
25+
id: setup-node
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version-file: .node-version
29+
cache: npm
30+
31+
- name: Install Dependencies
32+
id: npm-ci
33+
run: npm ci
34+
35+
- name: Check Format
36+
id: npm-format-check
37+
run: npm run format:check
38+
39+
- name: Lint
40+
id: npm-lint
41+
run: npm run lint
42+
43+
- name: Test
44+
id: npm-ci-test
45+
run: npm run ci-test
46+
47+
test-action:
48+
name: GitHub Actions Test
49+
runs-on: ubuntu-latest
50+
51+
steps:
52+
- name: Checkout
53+
id: checkout
54+
uses: actions/checkout@v4
55+
56+
- name: Test Local Action
57+
id: test-action
58+
uses: ./
59+
with:
60+
milliseconds: 2000
61+
62+
- name: Print Output
63+
id: output
64+
run: echo "${{ steps.test-action.outputs.time }}"

.github/workflows/codeql-analysis.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CodeQL
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
schedule:
11+
- cron: '31 7 * * 3'
12+
13+
permissions:
14+
actions: read
15+
checks: write
16+
contents: read
17+
security-events: write
18+
19+
jobs:
20+
analyze:
21+
name: Analyze
22+
runs-on: ubuntu-latest
23+
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
language:
28+
- TypeScript
29+
30+
steps:
31+
- name: Checkout
32+
id: checkout
33+
uses: actions/checkout@v4
34+
35+
- name: Initialize CodeQL
36+
id: initialize
37+
uses: github/codeql-action/init@v3
38+
with:
39+
languages: ${{ matrix.language }}
40+
source-root: src
41+
42+
- name: Autobuild
43+
id: autobuild
44+
uses: github/codeql-action/autobuild@v3
45+
46+
- name: Perform CodeQL Analysis
47+
id: analyze
48+
uses: github/codeql-action/analyze@v3

.github/workflows/linter.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Lint Codebase
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
permissions:
12+
contents: read
13+
packages: read
14+
statuses: write
15+
16+
jobs:
17+
lint:
18+
name: Lint Codebase
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout
23+
id: checkout
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Setup Node.js
29+
id: setup-node
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version-file: .node-version
33+
cache: npm
34+
35+
- name: Install Dependencies
36+
id: install
37+
run: npm ci
38+
39+
- name: Lint Codebase
40+
id: super-linter
41+
uses: super-linter/super-linter/slim@v7
42+
env:
43+
DEFAULT_BRANCH: main
44+
FILTER_REGEX_EXCLUDE: dist/**/*
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
LINTER_RULES_PATH: ${{ github.workspace }}
47+
VALIDATE_ALL_CODEBASE: true
48+
VALIDATE_JAVASCRIPT_ES: false
49+
VALIDATE_JAVASCRIPT_STANDARD: false
50+
VALIDATE_JSCPD: false
51+
VALIDATE_TYPESCRIPT_ES: false
52+
VALIDATE_JSON: false
53+
VALIDATE_TYPESCRIPT_STANDARD: false

0 commit comments

Comments
 (0)