Skip to content

Commit 10a5bba

Browse files
authored
Initial commit
0 parents  commit 10a5bba

35 files changed

+38538
-0
lines changed

.devcontainer/devcontainer.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "GitHub Actions (JavaScript)",
3+
"image": "mcr.microsoft.com/devcontainers/javascript-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

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

.gitattributes

Lines changed: 3 additions & 0 deletions
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/codeql/codeql-config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
name: JavaScript CodeQL Configuration
2+
3+
paths-ignore:
4+
- node_modules
5+
- dist

.github/dependabot.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
groups:
18+
npm-development:
19+
dependency-type: development
20+
update-types:
21+
- minor
22+
- patch
23+
npm-production:
24+
dependency-type: production
25+
update-types:
26+
- patch

.github/workflows/check-dist.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# In JavaScript 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+
# Checkout the repository.
30+
- name: Checkout
31+
id: checkout
32+
uses: actions/checkout@v4
33+
34+
# Setup Node.js using the version specified in `.node-version`.
35+
- name: Setup Node.js
36+
id: setup-node
37+
uses: actions/setup-node@v4
38+
with:
39+
node-version-file: .node-version
40+
cache: npm
41+
42+
# Install dependencies using `npm ci`.
43+
- name: Install Dependencies
44+
id: install
45+
run: npm ci
46+
47+
# Build the `dist/` directory.
48+
- name: Build dist/ Directory
49+
id: build
50+
run: npm run bundle
51+
52+
# This will fail the workflow if the `dist/` directory is different than
53+
# expected.
54+
- name: Compare Directories
55+
id: diff
56+
run: |
57+
if [ ! -d dist/ ]; then
58+
echo "Expected dist/ directory does not exist. See status below:"
59+
ls -la ./
60+
exit 1
61+
fi
62+
if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then
63+
echo "Detected uncommitted changes after build. See status below:"
64+
git diff --ignore-space-at-eol --text dist/
65+
exit 1
66+
fi
67+
68+
# If `dist/` was different than expected, upload the expected version as a
69+
# workflow artifact.
70+
- if: ${{ failure() && steps.diff.outcome == 'failure' }}
71+
name: Upload Artifact
72+
id: upload
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: dist
76+
path: dist/

.github/workflows/ci.yml

Lines changed: 64 additions & 0 deletions
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-javascript:
16+
name: JavaScript 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: 1000
61+
62+
- name: Print Output
63+
id: output
64+
run: echo "${{ steps.test-action.outputs.time }}"

.github/workflows/codeql-analysis.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: CodeQL
13+
14+
on:
15+
push:
16+
branches:
17+
- main
18+
pull_request:
19+
branches:
20+
- main
21+
schedule:
22+
- cron: '24 5 * * 6'
23+
24+
permissions:
25+
actions: read
26+
contents: read
27+
security-events: write
28+
29+
jobs:
30+
analyze:
31+
name: Analyze
32+
runs-on: ubuntu-latest
33+
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
language: ['javascript']
38+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
39+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
40+
41+
steps:
42+
- name: Checkout repository
43+
uses: actions/checkout@v4
44+
45+
# Initializes the CodeQL tools for scanning.
46+
- name: Initialize CodeQL
47+
uses: github/codeql-action/init@v3
48+
with:
49+
languages: ${{ matrix.language }}
50+
config-file: ./.github/codeql/codeql-config.yml
51+
# If you wish to specify custom queries, you can do so here or in a config file.
52+
# By default, queries listed here will override any specified in a config file.
53+
# Prefix the list here with "+" to use these queries and those in the config file.
54+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
55+
56+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
57+
# If this step fails, then you should remove it and run the build manually (see below)
58+
- name: Autobuild
59+
uses: github/codeql-action/autobuild@v3
60+
61+
# ℹ️ Command-line programs to run using the OS shell.
62+
# 📚 https://git.io/JvXDl
63+
64+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
65+
# and modify them (or add more) to build your code if your project
66+
# uses a compiled language
67+
68+
#- run: |
69+
# make bootstrap
70+
# make release
71+
72+
- name: Perform CodeQL Analysis
73+
uses: github/codeql-action/analyze@v3

0 commit comments

Comments
 (0)