Skip to content

Commit e0d93a9

Browse files
committed
Update spelling.yml
1 parent e9ae189 commit e0d93a9

File tree

1 file changed

+92
-6
lines changed

1 file changed

+92
-6
lines changed

.github/workflows/spelling.yml

Lines changed: 92 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,107 @@
11
name: Spell checking
2-
on: [pull_request_target, push, issue_comment]
2+
on:
3+
push:
4+
branches:
5+
- "**"
6+
tags-ignore:
7+
- "**"
8+
pull_request_target:
9+
issue_comment:
10+
types: [created]
311

412
jobs:
5-
build:
13+
spelling:
614
name: Spell checking
15+
permissions:
16+
checks: write
17+
contents: read
718
runs-on: ubuntu-latest
19+
if: "contains(github.event_name, 'pull_request') || github.event_name == 'push'"
820
steps:
921
- name: checkout-merge
1022
if: "contains(github.event_name, 'pull_request')"
11-
uses: actions/checkout@v2.3.4
23+
uses: actions/checkout@v2
1224
with:
1325
ref: refs/pull/${{github.event.pull_request.number}}/merge
1426
- name: checkout
15-
if: "!contains(github.event_name, 'pull_request')"
16-
uses: actions/[email protected]
27+
if: github.event_name == 'push'
28+
uses: actions/checkout@v2
29+
with:
30+
ref: ${{ github.event.pull_request.head.sha }}
31+
- name: check-spelling
32+
id: spelling
33+
uses: check-spelling/check-spelling@prerelease
34+
with:
35+
config: .github/actions/spell-check
36+
experimental_apply_changes_via_bot: 1
37+
suppress_push_for_open_pull_request: 1
38+
post_comment: 0
39+
- name: store-comment
40+
if: failure()
41+
uses: actions/upload-artifact@v2
42+
with:
43+
name: "check-spelling-comment-${{ github.run_id }}"
44+
path: |
45+
${{ steps.spelling.outputs.skipped_files }}
46+
${{ steps.spelling.outputs.stale_words }}
47+
${{ steps.spelling.outputs.unknown_words }}
48+
${{ steps.spelling.outputs.suggested_dictionaries }}
49+
${{ steps.spelling.outputs.warnings }}
50+
51+
comment:
52+
name: Comment
53+
runs-on: ubuntu-latest
54+
needs: spelling
55+
permissions:
56+
contents: write
57+
pull-requests: write
58+
if: always() && needs.spelling.result == 'failure'
59+
steps:
60+
- name: checkout
61+
uses: actions/checkout@v2
62+
- name: set up
63+
run: |
64+
mkdir /tmp/data
65+
- name: retrieve-comment
66+
uses: actions/download-artifact@v2
67+
with:
68+
name: "check-spelling-comment-${{ github.run_id }}"
69+
path: /tmp/data
70+
- name: comment
71+
uses: check-spelling/check-spelling@prerelease
72+
with:
73+
config: .github/actions/spell-check
74+
experimental_apply_changes_via_bot: 1
75+
debug: 1
76+
env:
77+
CUSTOM_TASK: comment
78+
NEW_TOKENS: /tmp/data/tokens.txt
79+
STALE_TOKENS: /tmp/data/remove_words.txt
80+
NEW_EXCLUDES: /tmp/data/should_exclude.txt
81+
SUGGESTED_DICTIONARIES: /tmp/data/suggested_dictionaries.json
1782

18-
- uses: jsoref/check-spelling@prerelease
83+
update:
84+
name: Update PR
85+
permissions:
86+
checks: write
87+
issues: write
88+
contents: write
89+
pull-requests: write
90+
runs-on: ubuntu-latest
91+
if: ${{
92+
github.event_name == 'issue_comment' &&
93+
contains(github.event.comment.body, '@check-spelling-bot apply')
94+
}}
95+
steps:
96+
- name: View context attributes
97+
uses: actions/github-script@v4
98+
with:
99+
script: console.log(github.event)
100+
- name: checkout-base
101+
uses: actions/checkout@v2
102+
- name: check-spelling
103+
uses: check-spelling/check-spelling@prerelease
19104
with:
20105
config: .github/actions/spell-check
21106
experimental_apply_changes_via_bot: 1
107+
debug: 1

0 commit comments

Comments
 (0)