Skip to content

Commit 7a74808

Browse files
committed
Update spelling.yml
1 parent e9ae189 commit 7a74808

File tree

1 file changed

+77
-6
lines changed

1 file changed

+77
-6
lines changed

.github/workflows/spelling.yml

Lines changed: 77 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,92 @@
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+
contents: read
17+
pull-requests: 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+
- name: check-spelling
30+
id: spelling
31+
uses: check-spelling/check-spelling@prerelease
32+
with:
33+
config: .github/actions/spell-check
34+
experimental_apply_changes_via_bot: 1
35+
suppress_push_for_open_pull_request: 1
36+
post_comment: 0
37+
- name: store-comment
38+
if: failure()
39+
uses: actions/upload-artifact@v2
40+
with:
41+
name: "check-spelling-comment-${{ github.run_id }}"
42+
path: |
43+
${{ steps.spelling.outputs.internal_state_directory }}
1744
18-
- uses: jsoref/check-spelling@prerelease
45+
comment:
46+
name: Comment
47+
runs-on: ubuntu-latest
48+
needs: spelling
49+
permissions:
50+
contents: write
51+
pull-requests: write
52+
if: always() && needs.spelling.result == 'failure'
53+
steps:
54+
- name: checkout
55+
uses: actions/checkout@v2
56+
- name: set up
57+
run: |
58+
mkdir /tmp/data
59+
- name: retrieve-comment
60+
uses: actions/download-artifact@v2
61+
with:
62+
name: "check-spelling-comment-${{ github.run_id }}"
63+
path: /tmp/data
64+
- name: comment
65+
uses: check-spelling/check-spelling@prerelease
66+
with:
67+
config: .github/actions/spell-check
68+
experimental_apply_changes_via_bot: 1
69+
custom_task: comment
70+
internal_state_directory: /tmp/data
71+
debug: 1
72+
73+
update:
74+
name: Update PR
75+
permissions:
76+
contents: write
77+
pull-requests: write
78+
runs-on: ubuntu-latest
79+
if: ${{
80+
github.event_name == 'issue_comment' &&
81+
github.event.issue.pull_request &&
82+
contains(github.event.comment.body, '@check-spelling-bot apply')
83+
}}
84+
steps:
85+
- name: checkout
86+
uses: actions/checkout@v2
87+
- name: check-spelling
88+
uses: check-spelling/check-spelling@prerelease
1989
with:
2090
config: .github/actions/spell-check
2191
experimental_apply_changes_via_bot: 1
92+
debug: 1

0 commit comments

Comments
 (0)