mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-12-19 06:29:47 +01:00
ci: check for typos in the source tree
This commit is contained in:
parent
f86f8bb9dc
commit
0e14e8008b
3 changed files with 33 additions and 1 deletions
2
.github/typos.toml
vendored
Normal file
2
.github/typos.toml
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
|
||||
default.extend-ignore-words-re = ["(?i)(noice)", "befores", "annote"]
|
2
.github/workflows/editorconfig.yml
vendored
2
.github/workflows/editorconfig.yml
vendored
|
@ -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"
|
||||
|
||||
|
|
30
.github/workflows/typos.yml
vendored
Normal file
30
.github/workflows/typos.yml
vendored
Normal file
|
@ -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
|
Loading…
Reference in a new issue