diff --git a/.github/actionlint-matcher.json b/.github/actionlint-matcher.json new file mode 100644 index 0000000..4613e16 --- /dev/null +++ b/.github/actionlint-matcher.json @@ -0,0 +1,17 @@ +{ + "problemMatcher": [ + { + "owner": "actionlint", + "pattern": [ + { + "regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$", + "file": 1, + "line": 2, + "column": 3, + "message": 4, + "code": 5 + } + ] + } + ] +} diff --git a/.github/labels.yml b/.github/labels.yml new file mode 100644 index 0000000..af433b8 --- /dev/null +++ b/.github/labels.yml @@ -0,0 +1,19 @@ +- name: "bug" + color: "#d73a4a" + description: "Something isn't working" +- name: "documentation" + color: "#e99695" + description: "Improvements or additions to documentation" +- name: "duplicate" + color: "#cfd3d7" + description: "This issue or pull request already exists" +- name: "enhancement" + color: "#a22eef" + description: "New feature or request" +- name: "renovate" + color: "#272895" +- name: "question" + color: "#d876e3" +- name: "wontfix" + color: "#ffffff" + description: "This will not be worked on" diff --git a/.github/workflows/actionlint.yml b/.github/workflows/actionlint.yml new file mode 100644 index 0000000..ac04f09 --- /dev/null +++ b/.github/workflows/actionlint.yml @@ -0,0 +1,21 @@ +name: Lint GitHub Actions workflows + +permissions: + contents: read + +on: [push, pull_request] + +jobs: + actionlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Download actionlint + id: get_actionlint + run: | + echo "::add-matcher::.github/actionlint-matcher.json" + bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) + shell: bash + - name: Check workflow files + run: ${{ steps.get_actionlint.outputs.executable }} -color + shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6a8a56d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: CI + +permissions: + contents: read + +on: + pull_request: + branches: [main] + +env: + CLICOLOR: 1 + +jobs: + spelling: + name: Spell Check with Typos + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v4 + - name: Spell Check Repo + uses: crate-ci/typos@v1.31.1 + js: + name: Check linting and formatting + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Install dependencies + run: npm clean-install + - name: Check formatting with Prettier + run: npm run prettier:check + - name: Code linting with ESLint + run: npm run lint diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml new file mode 100644 index 0000000..46efd90 --- /dev/null +++ b/.github/workflows/labels.yml @@ -0,0 +1,30 @@ +name: GitHub + +on: + push: + branches: + - "main" + paths: + - ".github/labels.yml" + - ".github/workflows/labels.yml" + pull_request: + paths: + - ".github/labels.yml" + - ".github/workflows/labels.yml" + +jobs: + labeler: + name: Labeler + runs-on: ubuntu-latest + permissions: + contents: read + issues: write + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Run Labeler + uses: crazy-max/ghaction-github-labeler@v5 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + yaml-file: .github/labels.yml + dry-run: ${{ github.event_name == 'pull_request' }} diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml new file mode 100644 index 0000000..048ecff --- /dev/null +++ b/.github/workflows/markdownlint.yml @@ -0,0 +1,16 @@ +name: CI + +permissions: + contents: read + +on: push + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: DavidAnson/markdownlint-cli2-action@v19 + with: + globs: | + README.md