From 6962b7f84499327ba10043e98f04863f2c492250 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=90=91=E5=A4=9C?= Date: Fri, 19 Jul 2024 16:24:27 +0800 Subject: [PATCH] ci(lint): add lint workflows --- .changeset/small-zebras-speak.md | 2 ++ .github/workflows/cspell.yml | 22 +++++++++++++++++ .github/workflows/lint-pr-title.yml | 38 +++++++++++++++++++++++++++++ cspell.json | 26 ++++++++++++++++++++ 4 files changed, 88 insertions(+) create mode 100644 .changeset/small-zebras-speak.md create mode 100644 .github/workflows/cspell.yml create mode 100644 .github/workflows/lint-pr-title.yml create mode 100644 cspell.json diff --git a/.changeset/small-zebras-speak.md b/.changeset/small-zebras-speak.md new file mode 100644 index 0000000..a845151 --- /dev/null +++ b/.changeset/small-zebras-speak.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.github/workflows/cspell.yml b/.github/workflows/cspell.yml new file mode 100644 index 0000000..4e62554 --- /dev/null +++ b/.github/workflows/cspell.yml @@ -0,0 +1,22 @@ +name: CSpell + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +jobs: + lint-cspell: + name: Lint CSpell + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: streetsidesoftware/cspell-action@v6 + with: + files: "**" + config: cspell.json + strict: true + verbose: true diff --git a/.github/workflows/lint-pr-title.yml b/.github/workflows/lint-pr-title.yml new file mode 100644 index 0000000..31b1b63 --- /dev/null +++ b/.github/workflows/lint-pr-title.yml @@ -0,0 +1,38 @@ +name: Lint Pr Title + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + - reopened + +permissions: + pull-requests: read + +jobs: + lint-pr-title: + name: Validating PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + types: | + fix + feat + docs + style + refactor + perf + test + build + ci + chore + revert + release + requireScope: false + ignoreLabels: | + bot diff --git a/cspell.json b/cspell.json new file mode 100644 index 0000000..d9ce26a --- /dev/null +++ b/cspell.json @@ -0,0 +1,26 @@ +{ + "$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json", + "words": [ + "aarch", + "androideabi", + "cdylib", + "gnueabihf", + "msvc", + "napi", + "ntscl", + "oxlint", + "prebuild", + "taplo", + "tinybench" + ], + "ignoreWords": [ + "armv" + ], + "ignorePaths": [ + "**/node_modules/**", + "**/target/**", + "./npm/*", + "index.js", + "README.md" + ] +}