Skip to content

Commit 663a409

Browse files
authored
Create spellcheck.yml
1 parent f8bb1cc commit 663a409

1 file changed

Lines changed: 108 additions & 0 deletions

File tree

.github/workflows/spellcheck.yml

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

0 commit comments

Comments
 (0)