Skip to content

Commit 79a8ab0

Browse files
authored
[actions] update sandpaper workflow to version 0.11.11
1 parent 0fb08e8 commit 79a8ab0

File tree

4 files changed

+24
-9
lines changed

4 files changed

+24
-9
lines changed

.github/workflows/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ pull request. GitHub has safeguarded the token used in this workflow to have no
147147
priviledges in the repository, but we have taken precautions to protect against
148148
spoofing.
149149

150+
This workflow is triggered with every push to a pull request. If this workflow
151+
is already running and a new push is sent to the pull request, the workflow
152+
running from the previous push will be cancelled and a new workflow run will be
153+
started.
154+
150155
The first step of this workflow is to check if it is valid (e.g. that no
151156
workflow files have been modified). If there are workflow files that have been
152157
modified, a comment is made that indicates that the workflow is not run. If
@@ -160,7 +165,7 @@ request. This builds the content and uploads three artifacts:
160165
3. The rendered files (build)
161166

162167
Because this workflow builds generated content, it follows the same general
163-
process as the sandpaper-main workflow with the same caching mechanisms.
168+
process as the `sandpaper-main` workflow with the same caching mechanisms.
164169

165170
The artifacts produced are used by the next workflow.
166171

@@ -176,7 +181,7 @@ The steps in this workflow are:
176181
3. If it is valid: update the pull request comment with the summary of changes
177182

178183
Importantly: if the pull request is invalid, the branch is not created so any
179-
malicious code is not published.
184+
malicious code is not published.
180185

181186
From here, the maintainer can request changes from the author and eventually
182187
either merge or reject the PR. When this happens, if the PR was valid, the

.github/workflows/pr-comment.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ on:
88
types:
99
- completed
1010

11+
concurrency:
12+
group: pr-${{ github.event.workflow_run.pull_requests[0].number }}
13+
cancel-in-progress: true
14+
15+
1116
jobs:
1217
# Pull requests are valid if:
1318
# - they match the sha of the workflow run head commit
@@ -16,8 +21,8 @@ jobs:
1621
test-pr:
1722
name: "Test if pull request is valid"
1823
runs-on: ubuntu-latest
19-
if: >
20-
github.event.workflow_run.event == 'pull_request' &&
24+
if: >
25+
github.event.workflow_run.event == 'pull_request' &&
2126
github.event.workflow_run.conclusion == 'success'
2227
outputs:
2328
is_valid: ${{ steps.check-pr.outputs.VALID }}
@@ -58,6 +63,7 @@ jobs:
5863
with:
5964
pr: ${{ steps.get-pr.outputs.NUM }}
6065
sha: ${{ github.event.workflow_run.head_sha }}
66+
headroom: 3 # if it's within the last three commits, we can keep going, because it's likely rapid-fire
6167
invalid: ${{ fromJSON(steps.hash.outputs.json)[github.repository] }}
6268
fail_on_error: true
6369

@@ -98,9 +104,9 @@ jobs:
98104
git config --local user.name "GitHub Actions"
99105
CURR_HEAD=$(git rev-parse HEAD)
100106
git checkout --orphan md-outputs-PR-${NR}
101-
git add -A
107+
git add -A
102108
git commit -m "source commit: ${CURR_HEAD}"
103-
ls -A | grep -v '^.git$' | xargs rm -r
109+
ls -A | grep -v '^.git$' | xargs -I _ rm -r '_'
104110
cd ..
105111
unzip -o -d built built.zip
106112
cd built
@@ -123,7 +129,7 @@ jobs:
123129
with:
124130
run: ${{ github.event.workflow_run.id }}
125131
name: 'diff'
126-
132+
127133
- if: ${{ steps.dl.outputs.success == 'true' }}
128134
run: unzip ${{ github.workspace }}/diff.zip
129135

@@ -132,7 +138,7 @@ jobs:
132138
if: ${{ steps.dl.outputs.success == 'true' }}
133139
uses: carpentries/actions/comment-diff@main
134140
with:
135-
pr: ${{ env.NR }}
141+
pr: ${{ env.NR }}
136142
path: ${{ github.workspace }}/diff.md
137143

138144
# Comment if the PR is open and matches the SHA, but the workflow files have

.github/workflows/pr-receive.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
types:
66
[opened, synchronize, reopened]
77

8+
concurrency:
9+
group: ${{ github.ref }}
10+
cancel-in-progress: true
11+
812
jobs:
913
test-pr:
1014
name: "Record PR number"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.10.8
1+
0.11.11

0 commit comments

Comments
 (0)