Skip to content

Commit 62a6e3c

Browse files
qualiaMachinegithub-actions[bot]
authored andcommitted
[actions] update sandpaper workflow to version 1.0.1
1 parent f7a7513 commit 62a6e3c

10 files changed

Lines changed: 178 additions & 267 deletions

.github/workflows/README.md

Lines changed: 114 additions & 166 deletions
Large diffs are not rendered by default.

.github/workflows/docker_apply_cache.yaml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ jobs:
132132
- ${{ github.workspace }}:/home/rstudio/lesson
133133
options: --cpus 2
134134
steps:
135-
- uses: actions/checkout@v4
135+
- uses: actions/checkout@v6
136136

137137
- name: "Debugging Info"
138138
run: |
@@ -187,15 +187,15 @@ jobs:
187187
steps.validate-org-workflow.outputs.is_valid == 'true' &&
188188
env.role-to-assume != '' &&
189189
env.aws-region != ''
190-
uses: aws-actions/configure-aws-credentials@v5.0.0
190+
uses: aws-actions/configure-aws-credentials@v6
191191
with:
192192
role-to-assume: ${{ env.role-to-assume }}
193193
aws-region: ${{ env.aws-region }}
194194
output-credentials: true
195195

196196
- name: "Upload cache object to S3"
197197
id: upload-cache
198-
uses: carpentries/actions-cache@frog-matchedkey-1
198+
uses: tespkg/actions-cache@v1.10.0
199199
with:
200200
accessKey: ${{ steps.aws-creds.outputs.aws-access-key-id }}
201201
secretKey: ${{ steps.aws-creds.outputs.aws-secret-access-key }}
@@ -208,20 +208,22 @@ jobs:
208208
restore-keys:
209209
${{ github.repository }}/${{ steps.wb-vers.outputs.container-version }}_renv-
210210

211-
trigger-build-deploy:
212-
name: "Trigger Build and Deploy Workflow"
211+
record-cache-result:
212+
name: "Record Caching Status"
213213
runs-on: ubuntu-latest
214-
needs: update-renv-cache
215-
if: |
216-
needs.update-renv-cache.result == 'success' ||
217-
needs.check-renv.outputs.renv-cache-available == 'true'
214+
needs: [check-renv, update-renv-cache]
215+
if: always()
216+
env:
217+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
218218
steps:
219-
- uses: actions/checkout@v4
219+
- name: "Record cache result"
220220

221-
- name: "Trigger Build and Deploy Workflow"
222-
env:
223-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
224221
run: |
225-
gh workflow run docker_build_deploy.yaml --ref main
222+
echo "${{ needs.update-renv-cache.result == 'success' || needs.check-renv.outputs.renv-cache-available == 'true' || 'false' }}" > ${{ github.workspace }}/apply-cache-result
226223
shell: bash
227-
continue-on-error: true
224+
225+
- name: "Upload cache result"
226+
uses: actions/upload-artifact@v7
227+
with:
228+
name: apply-cache-result
229+
path: ${{ github.workspace }}/apply-cache-result

.github/workflows/docker_build_deploy.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@ on:
44
push:
55
branches:
66
- 'main'
7+
- 'l10n_main'
78
paths-ignore:
89
- '.github/workflows/**.yaml'
910
- '.github/workbench-docker-version.txt'
1011
schedule:
1112
- cron: '0 0 * * 2'
13+
workflow_run:
14+
workflows: ["03 Maintain: Apply Package Cache"]
15+
types:
16+
- completed
1217
workflow_dispatch:
1318
inputs:
1419
name:
@@ -56,7 +61,7 @@ jobs:
5661

5762
- name: "Checkout Lesson"
5863
if: steps.build-check.outputs.do-build == 'true'
59-
uses: actions/checkout@v4
64+
uses: actions/checkout@v6
6065

6166
- name: "Get container version info"
6267
id: wb-vers
@@ -72,7 +77,6 @@ jobs:
7277
runs-on: ubuntu-latest
7378
needs: preflight
7479
if: |
75-
always() &&
7680
needs.preflight.outputs.do-build == 'true' &&
7781
needs.preflight.outputs.workbench-update != 'true'
7882
env:
@@ -95,7 +99,7 @@ jobs:
9599
- ${{ github.workspace }}:/home/rstudio/lesson
96100
options: --cpus 1
97101
steps:
98-
- uses: actions/checkout@v4
102+
- uses: actions/checkout@v6
99103

100104
- name: "Debugging Info"
101105
run: |
@@ -129,6 +133,7 @@ jobs:
129133
with:
130134
reset: ${{ vars.BUILD_RESET || github.event.inputs.reset || 'false' }}
131135
skip-manage-deps: ${{ github.event.inputs.force-skip-manage-deps == 'true' || steps.build-container-deps.outputs.renv-cache-available || steps.build-container-deps.outputs.backup-cache-used || 'false' }}
136+
lang-code: ${{ vars.LANG_CODE || '' }}
132137

133138
update-container-version:
134139
name: "Update container version used"

.github/workflows/docker_pr_receive.yaml

Lines changed: 14 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,14 @@ permissions:
1919
pull-requests: write
2020

2121
jobs:
22-
2322
preflight:
2423
name: "Preflight: md-outputs exists?"
2524
runs-on: ubuntu-latest
2625
outputs:
2726
branch-exists: ${{ steps.check.outputs.exists }}
2827
steps:
2928
- name: "Checkout Lesson"
30-
uses: actions/checkout@v4
29+
uses: actions/checkout@v6
3130

3231
- name: "Check if md-outputs branch exists"
3332
id: check
@@ -49,7 +48,9 @@ jobs:
4948

5049
test-pr:
5150
name: "Record PR number"
52-
if: ${{ github.event.action != 'closed' }} && ${{ needs.preflight.outputs.branch-exists == 'true' }}
51+
if: |
52+
github.event.action != 'closed' &&
53+
needs.preflight.outputs.branch-exists == 'true'
5354
runs-on: ubuntu-latest
5455
needs: preflight
5556
outputs:
@@ -75,7 +76,7 @@ jobs:
7576
- name: "Upload PR number"
7677
id: upload
7778
if: always()
78-
uses: actions/upload-artifact@v4
79+
uses: actions/upload-artifact@v7
7980
with:
8081
name: pr
8182
path: ${{ github.workspace }}/NR
@@ -108,7 +109,7 @@ jobs:
108109
renv-cache-hashsum: ${{ steps.renv-check.outputs.renv-cache-hashsum }}
109110
steps:
110111
- name: "Checkout Lesson"
111-
uses: actions/checkout@v4
112+
uses: actions/checkout@v6
112113

113114
- name: "Is renv required?"
114115
id: renv-check
@@ -135,6 +136,7 @@ jobs:
135136
checks: write
136137
contents: write
137138
pages: write
139+
id-token: write
138140
container:
139141
image: ghcr.io/carpentries/workbench-docker:${{ vars.WORKBENCH_TAG || 'latest' }}
140142
env:
@@ -151,10 +153,10 @@ jobs:
151153
workbench-update: ${{ steps.wb-vers.outputs.workbench-update }}
152154
build-site: ${{ steps.build-site.outcome }}
153155
steps:
154-
- uses: actions/checkout@v4
156+
- uses: actions/checkout@v6
155157

156158
- name: "Check Out Staging Branch"
157-
uses: actions/checkout@v4
159+
uses: actions/checkout@v6
158160
with:
159161
ref: md-outputs
160162
path: ${{ env.GHWMD }}
@@ -203,15 +205,15 @@ jobs:
203205
needs.check-renv.outputs.renv-needed == 'true' &&
204206
env.role-to-assume != '' &&
205207
env.aws-region != ''
206-
uses: aws-actions/configure-aws-credentials@v5.0.0
208+
uses: aws-actions/configure-aws-credentials@v6
207209
with:
208210
role-to-assume: ${{ env.role-to-assume }}
209211
aws-region: ${{ env.aws-region }}
210212
output-credentials: true
211213

212214
- name: Get cache object from S3
213215
id: s3-cache
214-
uses: carpentries/actions-cache/restore@frog-matchedkey-1
216+
uses: tespkg/actions-cache/restore@v1.10.0
215217
if: needs.check-renv.outputs.renv-needed == 'true'
216218
with:
217219
# insecure: false # optional, use http instead of https. default false
@@ -256,21 +258,21 @@ jobs:
256258
shell: Rscript {0}
257259

258260
- name: "Upload PR"
259-
uses: actions/upload-artifact@v4
261+
uses: actions/upload-artifact@v7
260262
with:
261263
name: pr
262264
path: ${{ env.PR }}
263265
overwrite: true
264266

265267
- name: "Upload Diff"
266-
uses: actions/upload-artifact@v4
268+
uses: actions/upload-artifact@v7
267269
with:
268270
name: diff
269271
path: ${{ env.CHIVE }}
270272
retention-days: 1
271273

272274
- name: "Upload Build"
273-
uses: actions/upload-artifact@v4
275+
uses: actions/upload-artifact@v7
274276
with:
275277
name: built
276278
path: ${{ env.GHWMD }}
@@ -279,24 +281,3 @@ jobs:
279281
- name: "Teardown"
280282
run: sandpaper::reset_site()
281283
shell: Rscript {0}
282-
283-
pr-checks:
284-
name: "Trigger PR Checks?"
285-
needs:
286-
- test-pr
287-
- build-md-source
288-
runs-on: ubuntu-latest
289-
if: needs.test-pr.outputs.is_valid == 'true'
290-
permissions:
291-
actions: write
292-
checks: write
293-
steps:
294-
- name: "Checkout Lesson"
295-
uses: actions/checkout@v4
296-
297-
- name: "Trigger PR Checks"
298-
env:
299-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
300-
run: |
301-
gh workflow run pr-comment.yaml --ref main --field workflow_id=${{ github.run_id }}
302-
shell: bash

.github/workflows/pr-close-signal.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
mkdir -p ./pr
1717
printf ${{ github.event.number }} > ./pr/NUM
1818
- name: Upload Diff
19-
uses: actions/upload-artifact@v4
19+
uses: actions/upload-artifact@v7
2020
with:
2121
name: pr
2222
path: ./pr

.github/workflows/pr-comment.yaml

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
name: "Bot: Comment on the Pull Request"
22
description: "Comment on the pull request with the results of the markdown generation"
33
on:
4-
workflow_dispatch:
5-
inputs:
6-
workflow_id:
7-
required: true
8-
9-
concurrency:
10-
group: pr-${{ github.event.workflow_run.pull_requests[0].number }}
11-
cancel-in-progress: true
4+
workflow_run:
5+
workflows: ["Bot: Receive Pull Request"]
6+
types:
7+
- completed
128

139
jobs:
1410
# Pull requests are valid if:
@@ -18,16 +14,6 @@ jobs:
1814
test-pr:
1915
name: "Test if pull request is valid"
2016
runs-on: ubuntu-latest
21-
if: >
22-
github.event_name == 'workflow_dispatch' ||
23-
(
24-
github.event_name == 'workflow_run' &&
25-
(
26-
github.event.workflow_run.event == 'pull_request' ||
27-
github.event.workflow_run.event == 'workflow_dispatch'
28-
) &&
29-
github.event.workflow_run.conclusion == 'success'
30-
)
3117
outputs:
3218
is_valid: ${{ steps.check-pr.outputs.VALID }}
3319
payload: ${{ steps.check-pr.outputs.payload }}
@@ -38,7 +24,7 @@ jobs:
3824
id: dl
3925
uses: carpentries/actions/download-workflow-artifact@main
4026
with:
41-
run: ${{ github.event.workflow_run.id || inputs.workflow_id }}
27+
run: ${{ github.event.workflow_run.id }}
4228
name: 'pr'
4329

4430
- name: "Get PR Number"
@@ -56,7 +42,7 @@ jobs:
5642
exit 1
5743
5844
- name: "Checkout Lesson"
59-
uses: actions/checkout@v4
45+
uses: actions/checkout@v6
6046

6147
- name: "Verify committed files"
6248
id: changed-files
@@ -79,11 +65,9 @@ jobs:
7965

8066
- name: "Skip checks for Workbench version file updates"
8167
if: steps.changed-files.outputs.only_version_file == 'true'
82-
env:
83-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8468
run: |
85-
echo "Only workbench-docker-version.txt changed, skipping preflight checks and running cache update"
86-
gh workflow run update-cache.yaml --ref main
69+
echo "# 🔧 Wait for Next Cache Update #"
70+
echo "Only workbench-docker-version.txt changed."
8771
exit 0
8872
shell: bash
8973

@@ -128,7 +112,7 @@ jobs:
128112
contents: write
129113
steps:
130114
- name: "Checkout md outputs"
131-
uses: actions/checkout@v4
115+
uses: actions/checkout@v6
132116
with:
133117
ref: md-outputs
134118
path: built
@@ -138,7 +122,7 @@ jobs:
138122
id: dl
139123
uses: carpentries/actions/download-workflow-artifact@main
140124
with:
141-
run: ${{ github.event.workflow_run.id || inputs.workflow_id }}
125+
run: ${{ github.event.workflow_run.id }}
142126
name: 'built'
143127

144128
- if: steps.dl.outputs.success == 'true'
@@ -177,7 +161,7 @@ jobs:
177161
id: dl
178162
uses: carpentries/actions/download-workflow-artifact@main
179163
with:
180-
run: ${{ github.event.workflow_run.id || inputs.workflow_id }}
164+
run: ${{ github.event.workflow_run.id }}
181165
name: 'diff'
182166

183167
- if: steps.dl.outputs.success == 'true'
@@ -210,7 +194,7 @@ jobs:
210194
id: dl
211195
uses: carpentries/actions/download-workflow-artifact@main
212196
with:
213-
run: ${{ github.event.workflow_run.id || inputs.workflow_id }}
197+
run: ${{ github.event.workflow_run.id }}
214198
name: 'built'
215199

216200
- name: "Alert if spoofed"

.github/workflows/sandpaper-version.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)