From 0e14e8008b014c36be0a09ee1b36110fd58d84ef Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Tue, 26 Nov 2024 11:20:34 +0300 Subject: [PATCH] ci: check for typos in the source tree --- .github/typos.toml | 2 ++ .github/workflows/editorconfig.yml | 2 +- .github/workflows/typos.yml | 30 ++++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .github/typos.toml create mode 100644 .github/workflows/typos.yml diff --git a/.github/typos.toml b/.github/typos.toml new file mode 100644 index 00000000..cd7b3a0b --- /dev/null +++ b/.github/typos.toml @@ -0,0 +1,2 @@ + +default.extend-ignore-words-re = ["(?i)(noice)", "befores", "annote"] diff --git a/.github/workflows/editorconfig.yml b/.github/workflows/editorconfig.yml index 68176c7f..d411c89f 100644 --- a/.github/workflows/editorconfig.yml +++ b/.github/workflows/editorconfig.yml @@ -15,7 +15,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | gh api \ - repos/notashelf/neovim-flake/pulls/${{github.event.number}}/files --paginate \ + repos/notashelf/nvf/pulls/${{github.event.number}}/files --paginate \ | jq '.[] | select(.status != "removed") | .filename' \ > "$HOME/changed_files" diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml new file mode 100644 index 00000000..d74ee5b7 --- /dev/null +++ b/.github/workflows/typos.yml @@ -0,0 +1,30 @@ +name: "Check for typos in the source tree" + +permissions: read-all + +on: + pull_request: + workflow_dispatch: + push: + +jobs: + check-typos: + runs-on: ubuntu-latest + if: "!contains(github.event.pull_request.title, '[skip ci]')" + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Check for typos + uses: crate-ci/typos@master + with: + config: .github/typos.toml + + - name: Fail Gracefully + if: ${{ failure() }} + shell: bash + run: | + echo "::error:: Current codebase contains typos that were caught by the CI!" + echo "If those typos were intentional, please add them to the ignored regexes in .github/typos.toml" + echo "[skip ci] label may be used if this is a one-time issue" + exit 1