Skip to content

Commit 5669701

Browse files
committed
ci: move typo check to lint.yml
1 parent e3f7d19 commit 5669701

File tree

2 files changed

+36
-33
lines changed

2 files changed

+36
-33
lines changed

.github/workflows/check-for-typos.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,39 @@ jobs:
4848
- name: Run Oxlint
4949
if: steps.get_changed_files.outputs.files_changed == 'true'
5050
run: xargs npm run lint:strict < changed_files.txt
51+
52+
check-for-typos:
53+
runs-on: ubuntu-latest
54+
# Skip the job if the PR has the specified tag/label
55+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no typo check') }}
56+
steps:
57+
- uses: actions/checkout@v4
58+
with:
59+
fetch-depth: 0
60+
- name: Get Changed Files (Compare with Main)
61+
id: get_changed_files
62+
run: |
63+
git fetch origin main --depth=1
64+
# TODO ideally lint the non-generated files in src/bindings/
65+
CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.ref }} | grep -E '\.(ts|js)$' | grep -v 'src/bindings/*' || true)
66+
67+
if [ -n "$CHANGED_FILES" ]; then
68+
echo "Files changed:"
69+
echo "$CHANGED_FILES"
70+
echo "$CHANGED_FILES" > changed_files.txt
71+
echo "files_changed=true" >> $GITHUB_OUTPUT
72+
else
73+
echo "No relevant files changed."
74+
echo "files_changed=false" >> $GITHUB_OUTPUT
75+
fi
76+
77+
- name: Run codespell on changed files
78+
if: steps.get_changed_files.outputs.files_changed == 'true'
79+
uses: codespell-project/actions-codespell@master
80+
with:
81+
check_filenames: true
82+
path: ${{ steps.get_changed_files.outputs.files }}
83+
skip: "*.json,./node_modules,./dist,./.husky,./.git,./src/mina/**/*,./src/bindings/**/*"
84+
check_hidden: false
85+
ignore_words_list: "tHi,modul,optin,deriver,PRing,toWords,iSelf"
86+

0 commit comments

Comments
 (0)