Skip to content

Commit e0421d2

Browse files
committed
Enhance spell-check workflow with triggers and fixes
Added scheduled and manual triggers for codespell checks and auto-fix jobs.
1 parent 2107a6a commit e0421d2

File tree

1 file changed

+37
-2
lines changed

1 file changed

+37
-2
lines changed

.github/workflows/spell-check.yml

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,48 @@
11
name: codespell
22

3-
on: [push, pull_request]
3+
on:
4+
schedule:
5+
- cron: '0 0 * * 0' # Run weekly on Sunday at midnight
6+
workflow_dispatch: # Allow manual trigger
7+
pull_request: # Still check PRs
48

59
jobs:
6-
codespell:
10+
codespell-check:
11+
# Only check on pull requests
12+
if: github.event_name == 'pull_request'
713
runs-on: ubuntu-latest
814
steps:
915
- uses: actions/checkout@v4
1016
- uses: codespell-project/actions-codespell@v2
1117
with:
1218
path: content/
1319
ignore_words_file: .codespell-ignore
20+
21+
codespell-fix:
22+
# Auto-fix and create PR on schedule or manual trigger
23+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
24+
runs-on: ubuntu-latest
25+
permissions:
26+
contents: write
27+
pull-requests: write
28+
steps:
29+
- uses: actions/checkout@v4
30+
31+
- name: Install codespell
32+
run: pip install codespell
33+
34+
- name: Run codespell with auto-fix
35+
run: codespell content/ -I .codespell-ignore -w
36+
37+
- name: Create Pull Request
38+
uses: peter-evans/create-pull-request@v6
39+
with:
40+
commit-message: 'Fix spelling errors found by codespell'
41+
title: 'Fix spelling errors'
42+
body: |
43+
This PR fixes spelling errors automatically detected by codespell.
44+
45+
Please review the changes carefully to ensure corrections are appropriate.
46+
branch: automated/spelling-fixes
47+
delete-branch: true
48+
labels: documentation, automated

0 commit comments

Comments
 (0)