Skip to content

Commit 21db4e4

Browse files
Spellcheck Workflow (#1249)
1 parent a04ee16 commit 21db4e4

4 files changed

Lines changed: 107 additions & 0 deletions

File tree

.github/actions/spelling/allow.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
github
2+
https
3+
solidjs
4+
jsx
5+
zeropsio
6+
zerops
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
\b(\w{3,})\s\g{-1}\b
2+
\bJavascript\b
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
\(data:.*?\)
2+
(['"])data:.*?\g{-1}
3+
data:[-a-zA-Z=;:/0-9+]*,\S*
4+
mailto:[-a-zA-Z=;:/?%&0-9+]*
5+
https?://\S+
6+
www\.\S+
7+
^```[\s\S]*?^```
8+

.github/workflows/spelling.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Check Spelling
2+
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
paths:
8+
- "**/routes/**"
9+
- "**.mdx"
10+
pull_request_target:
11+
branches:
12+
- "**"
13+
paths:
14+
- "**/routes/**"
15+
- "**.mdx"
16+
types:
17+
- "opened"
18+
- "reopened"
19+
- "synchronize"
20+
issue_comment:
21+
types:
22+
- "created"
23+
schedule:
24+
- cron: "0 12 * * *"
25+
26+
jobs:
27+
spelling:
28+
name: Check Spelling
29+
runs-on: ubuntu-latest
30+
permissions:
31+
contents: read
32+
pull-requests: read
33+
actions: read
34+
security-events: write
35+
outputs:
36+
followup: ${{ steps.spelling.outputs.followup }}
37+
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push'}}
38+
concurrency:
39+
group: spelling-${{ github.event.pull_request.number || github.ref }}
40+
steps:
41+
- name: check-spelling
42+
id: spelling
43+
uses: check-spelling/check-spelling@main
44+
with:
45+
suppress_push_for_open_pull_request: ${{ github.actor != 'dependabot[bot]' && 1 }}
46+
checkout: true
47+
check_file_names: 0
48+
spell_check_this: check-spelling/spell-check-this@main
49+
use_magic_file: 1
50+
report-timing: 1
51+
warnings: bad-regex,deprecated-feature,large-file,limited-references,noisy-file,non-alpha-in-dictionary,token-is-substring,whitespace-in-dictionary,unsupported-configuration,no-files-to-check
52+
use_sarif: ${{ (!github.event.pull_request || (github.event.pull_request.head.repo.full_name == github.repository)) && 1 }}
53+
extra_dictionary_limit: 20
54+
extra_dictionaries: cspell:software-terms/dict/softwareTerms.txt
55+
56+
comment-push:
57+
name: Report (Push)
58+
runs-on: ubuntu-latest
59+
needs: spelling
60+
permissions:
61+
contents: write
62+
if: (success() || failure()) && needs.spelling.outputs.followup && github.event_name == 'push'
63+
steps:
64+
- name: comment
65+
uses: check-spelling/check-spelling@main
66+
with:
67+
checkout: true
68+
spell_check_this: check-spelling/spell-check-this@main
69+
task: ${{ needs.spelling.outputs.followup }}
70+
71+
update:
72+
name: Update PR
73+
permissions:
74+
contents: write
75+
pull-requests: write
76+
runs-on: ubuntu-latest
77+
if: ${{
78+
github.event_name == 'issue_comment' &&
79+
github.event.issue.pull_request &&
80+
contains(github.event.comment.body, '@check-spelling-bot apply')
81+
}}
82+
concurrency:
83+
group: spelling-update-${{ github.event.issue.number }}
84+
cancel-in-progress: false
85+
steps:
86+
- name: apply spelling updates
87+
uses: check-spelling/check-spelling@main
88+
with:
89+
checkout: true
90+
spell_check_this: check-spelling/spell-check-this@main
91+
task: ${{ needs.spelling.outputs.followup }}

0 commit comments

Comments
 (0)