-
Notifications
You must be signed in to change notification settings - Fork 4.7k
69 lines (67 loc) · 2.03 KB
/
spelling.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Spell checking
on:
push:
branches: ["**"]
tags-ignore: ["**"]
pull_request_target:
jobs:
spelling:
name: Spell checking
permissions:
contents: read
pull-requests: read
outputs:
internal_state_directory: ${{ steps.spelling.outputs.internal_state_directory }}
runs-on: ubuntu-latest
if: "contains(github.event_name, 'pull_request') || github.event_name == 'push'"
concurrency:
group: spelling-${{ github.event.pull_request.number || github.ref }}
# note: If you use only_check_changed_files, you do not want cancel-in-progress
cancel-in-progress: true
steps:
- name: checkout-merge
if: "contains(github.event_name, 'pull_request')"
uses: actions/checkout@v2
with:
ref: refs/pull/${{github.event.pull_request.number}}/merge
- name: checkout
if: github.event_name == 'push'
uses: actions/checkout@v2
- name: check-spelling
id: spelling
uses: check-spelling/[email protected]
with:
suppress_push_for_open_pull_request: 1
post_comment: 0
- name: store-comment
if: failure()
uses: actions/upload-artifact@v2
with:
retention-days: 1
name: "check-spelling-comment-${{ github.run_id }}"
path: |
${{ steps.spelling.outputs.internal_state_directory }}
comment:
name: Comment
runs-on: ubuntu-latest
needs: spelling
permissions:
contents: write
pull-requests: write
if: always() && needs.spelling.result == 'failure' && needs.spelling.outputs.internal_state_directory
steps:
- name: checkout
uses: actions/checkout@v2
- name: set up
run: |
mkdir /tmp/data
- name: retrieve-comment
uses: actions/download-artifact@v2
with:
name: "check-spelling-comment-${{ github.run_id }}"
path: /tmp/data
- name: comment
uses: check-spelling/[email protected]
with:
custom_task: comment
internal_state_directory: /tmp/data