-
Notifications
You must be signed in to change notification settings - Fork 423
53 lines (49 loc) · 1.81 KB
/
spellcheck.yml
File metadata and controls
53 lines (49 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Spellcheck
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
pull-requests: write
jobs:
spellcheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# This ensures that the workflow can access the entire git history
# if needed for creating pull requests
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install codespell
run: |
sudo apt-get update
sudo apt-get install codespell -y
- name: Run codespell
continue-on-error: true
run: |
codespell -w --skip="*.git,*.js,*.json,*.lock,*.css,*.scss,*.svg,*.png,*.jpg,*.jpeg,*.gif,*.ico,*.woff,*.woff2,*.ttf,*.eot,node_modules,public,dist,.vitepress/dist,.vitepress/cache,yarn.lock" --ignore-words=.github/.codespellignore
- name: Check for changes
id: verify-changed-files
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "Files with spelling corrections:"
git status --porcelain
else
echo "changed=false" >> $GITHUB_OUTPUT
echo "No spelling errors found."
fi
- name: Create Pull Request
if: steps.verify-changed-files.outputs.changed == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "fix: correct spelling errors"
title: "fix: correct spelling errors"
body: |
This PR fixes spelling errors found by codespell.
Auto-generated by the spellcheck workflow.
branch: fix/spelling-corrections
delete-branch: true