|
1 | 1 | name: Check Spelling |
2 | 2 |
|
| 3 | +# Based on example in https://github.com/check-spelling/spell-check-this. |
| 4 | + |
3 | 5 | on: |
4 | | - pull_request: |
| 6 | + push: |
| 7 | + pull_request_target: |
| 8 | + branches: |
| 9 | + - "**" |
| 10 | + types: |
| 11 | + - 'opened' |
| 12 | + - 'reopened' |
| 13 | + - 'synchronize' |
| 14 | + issue_comment: |
| 15 | + types: |
| 16 | + - 'created' |
5 | 17 |
|
6 | 18 | jobs: |
7 | 19 | spelling: |
8 | 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 | + cancel-in-progress: true |
| 33 | + steps: |
| 34 | + - name: check-spelling |
| 35 | + id: spelling |
| 36 | + uses: check-spelling/check-spelling@prerelease |
| 37 | + with: |
| 38 | + suppress_push_for_open_pull_request: ${{ github.actor != 'dependabot[bot]' && 1 }} |
| 39 | + checkout: true |
| 40 | + check_file_names: 1 |
| 41 | + post_comment: 1 |
| 42 | + use_magic_file: 1 |
| 43 | + 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 |
| 44 | + use_sarif: ${{ (!github.event.pull_request || (github.event.pull_request.head.repo.full_name == github.repository)) && 1 }} |
| 45 | + extra_dictionary_limit: 20 |
| 46 | + extra_dictionaries: |
| 47 | + cspell:software-terms/dict/softwareTerms.txt |
| 48 | + cspell:bash/dict/bash-words.txt |
| 49 | + cspell:companies/dict/companies.txt |
| 50 | + cspell:filetypes/filetypes.txt |
| 51 | + |
| 52 | + comment-push: |
| 53 | + name: Report (Push) |
| 54 | + # If your workflow isn't running on push, you can remove this job |
| 55 | + runs-on: ubuntu-latest |
| 56 | + needs: spelling |
| 57 | + permissions: |
| 58 | + contents: write |
| 59 | + if: (success() || failure()) && needs.spelling.outputs.followup && github.event_name == 'push' |
| 60 | + steps: |
| 61 | + - name: comment |
| 62 | + uses: check-spelling/check-spelling@prerelease |
| 63 | + with: |
| 64 | + checkout: true |
| 65 | + spell_check_this: check-spelling/spell-check-this@prerelease |
| 66 | + task: ${{ needs.spelling.outputs.followup }} |
| 67 | + |
| 68 | + comment-pr: |
| 69 | + name: Report (PR) |
9 | 70 | runs-on: ubuntu-latest |
| 71 | + needs: spelling |
| 72 | + permissions: |
| 73 | + contents: read |
| 74 | + pull-requests: write |
| 75 | + if: (success() || failure()) && needs.spelling.outputs.followup && contains(github.event_name, 'pull_request') |
10 | 76 | steps: |
11 | | - - uses: actions/checkout@v3 |
12 | | - - name: Check spelling |
13 | | - id: spelling |
14 | | - # The given commit contains preliminary, unreleased, support for ignoring |
15 | | - # whole blocks (multi-line) from spell checking. See |
16 | | - # https://github.com/check-spelling/check-spelling/commit/46c981b7c96b3777aff4fd711fc9a8f126121b04 |
17 | | - # for more details. |
18 | | - uses: check-spelling/check-spelling@46c981b7c96b3777aff4fd711fc9a8f126121b04 |
19 | | - with: |
20 | | - check_file_names: 1 |
21 | | - post_comment: 0 |
22 | | - use_magic_file: 1 |
23 | | - 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 |
24 | | - use_sarif: 1 |
25 | | - extra_dictionary_limit: 20 |
26 | | - extra_dictionaries: |
27 | | - cspell:software-terms/dict/softwareTerms.txt |
28 | | - cspell:bash/dict/bash-words.txt |
29 | | - cspell:companies/dict/companies.txt |
30 | | - cspell:filetypes/filetypes.txt |
| 77 | + - name: comment |
| 78 | + uses: check-spelling/check-spelling@prerelease |
| 79 | + with: |
| 80 | + checkout: true |
| 81 | + spell_check_this: check-spelling/spell-check-this@prerelease |
| 82 | + task: ${{ needs.spelling.outputs.followup }} |
0 commit comments