|
3 | 3 |
|
4 | 4 | name: Check Spelling |
5 | 5 |
|
6 | | -# Comment management is handled through a secondary job, for details see: |
7 | | -# https://github.com/check-spelling/check-spelling/wiki/Feature%3A-Restricted-Permissions |
8 | | -# |
9 | | -# `jobs.comment-push` runs when a push is made to a repository and the `jobs.spelling` job needs to make a comment |
10 | | -# (in odd cases, it might actually run just to collapse a comment, but that's fairly rare) |
11 | | -# it needs `contents: write` in order to add a comment. |
12 | | -# |
13 | | -# `jobs.comment-pr` runs when a pull_request is made to a repository and the `jobs.spelling` job needs to make a comment |
14 | | -# or collapse a comment (in the case where it had previously made a comment and now no longer needs to show a comment) |
15 | | -# it needs `pull-requests: write` in order to manipulate those comments. |
16 | | - |
17 | | -# Updating pull request branches is managed via comment handling. |
18 | | -# For details, see: https://github.com/check-spelling/check-spelling/wiki/Feature:-Update-expect-list |
19 | | -# |
20 | | -# These elements work together to make it happen: |
21 | | -# |
22 | | -# `on.issue_comment` |
23 | | -# This event listens to comments by users asking to update the metadata. |
24 | | -# |
25 | | -# `jobs.update` |
26 | | -# This job runs in response to an issue_comment and will push a new commit |
27 | | -# to update the spelling metadata. |
28 | | -# |
29 | | -# `with.experimental_apply_changes_via_bot` |
30 | | -# Tells the action to support and generate messages that enable it |
31 | | -# to make a commit to update the spelling metadata. |
32 | | -# |
33 | | -# `with.ssh_key` |
34 | | -# In order to trigger workflows when the commit is made, you can provide a |
35 | | -# secret (typically, a write-enabled github deploy key). |
36 | | -# |
37 | | -# For background, see: https://github.com/check-spelling/check-spelling/wiki/Feature:-Update-with-deploy-key |
38 | | - |
39 | | -# SARIF reporting |
40 | | -# |
41 | | -# Access to SARIF reports is generally restricted (by GitHub) to members of the repository. |
42 | | -# |
43 | | -# Requires enabling `security-events: write` |
44 | | -# and configuring the action with `use_sarif: 1` |
45 | | -# |
46 | | -# For information on the feature, see: https://github.com/check-spelling/check-spelling/wiki/Feature:-SARIF-output |
47 | | - |
48 | | -# Minimal workflow structure: |
49 | | -# |
50 | | -# on: |
51 | | -# push: |
52 | | -# ... |
53 | | -# pull_request_target: |
54 | | -# ... |
55 | | -# jobs: |
56 | | -# # you only want the spelling job, all others should be omitted |
57 | | -# spelling: |
58 | | -# # remove `security-events: write` and `use_sarif: 1` |
59 | | -# # remove `experimental_apply_changes_via_bot: 1` |
60 | | -# ... otherwise adjust the `with:` as you wish |
61 | | - |
62 | 6 | on: |
63 | 7 | push: |
64 | 8 | branches: |
65 | 9 | - "**" |
66 | 10 | tags-ignore: |
67 | 11 | - "**" |
68 | | - pull_request_target: |
| 12 | + pull_request: |
69 | 13 | branches: |
70 | 14 | - "**" |
71 | 15 | types: |
|
80 | 24 | contents: read |
81 | 25 | pull-requests: read |
82 | 26 | actions: read |
83 | | - outputs: |
84 | | - followup: ${{ steps.spelling.outputs.followup }} |
85 | 27 | runs-on: ubuntu-latest |
86 | 28 | if: ${{ contains(github.event_name, 'pull_request') || github.event_name == 'push' }} |
87 | 29 | concurrency: |
@@ -127,20 +69,3 @@ jobs: |
127 | 69 | cspell:cpp/ecosystem.txt |
128 | 70 | cspell:typescript/typescript.txt |
129 | 71 | cspell:cpp/lang-keywords.txt |
130 | | -
|
131 | | - comment-pr: |
132 | | - name: Report (PR) |
133 | | - # If you workflow isn't running on pull_request*, you can remove this job |
134 | | - runs-on: ubuntu-latest |
135 | | - needs: spelling |
136 | | - permissions: |
137 | | - actions: read |
138 | | - contents: read |
139 | | - pull-requests: write |
140 | | - if: (success() || failure()) && needs.spelling.outputs.followup && contains(github.event_name, 'pull_request') |
141 | | - steps: |
142 | | - - name: comment |
143 | | - uses: check-spelling/check-spelling@cfb6f7e75bbfc89c71eaa30366d0c166f1bd9c8c # v0.0.26 |
144 | | - with: |
145 | | - checkout: true |
146 | | - task: ${{ needs.spelling.outputs.followup }} |
0 commit comments