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