Skip to content

Commit 7f60f15

Browse files
committed
ci: bump actions/checkout to v7.0.0 (#41055)
Bumps `actions/checkout` to v7.0.0 across all workflows. v7 refuses to check out fork-PR code under `pull_request_target`/`workflow_run` unless `allow-unsafe-pr-checkout: true` is set. Three steps intentionally check out fork-PR code, and we already defend against the malicious case (no persisted credentials; only trusted, base-built tooling runs against the checkout), so they get the opt-in: ``` ┌────────────────────────────────────────────┬──────────────────────────────────┬─────────────────────────────────────────────────────────┐ │ File │ Step │ Checked-out ref │ ├────────────────────────────────────────────┼──────────────────────────────────┼─────────────────────────────────────────────────────────┤ │ .github/workflows/add_label_from_diff.yaml │ "Checkout branch to label" (L50) │ ${{ github.event.pull_request.head.sha || github.sha }} │ ├────────────────────────────────────────────┼──────────────────────────────────┼─────────────────────────────────────────────────────────┤ │ .github/workflows/PR_summary.yml │ "Checkout code" (L29) │ ${{ github.event.pull_request.head.sha }} │ ├────────────────────────────────────────────┼──────────────────────────────────┼─────────────────────────────────────────────────────────┤ │ .github/workflows/decls-diff.yml │ "Checkout new commit" (L67) │ ${{ steps.meta.outputs.new-sha }} │ └────────────────────────────────────────────┴──────────────────────────────────┴─────────────────────────────────────────────────────────┘ ```
1 parent d6772ec commit 7f60f15

40 files changed

Lines changed: 86 additions & 77 deletions

.github/actions/get-mathlib-ci/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ then use the local action:
2525

2626
```yaml
2727
- name: Checkout local actions
28-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
28+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
2929
with:
3030
ref: ${{ github.workflow_sha }}
3131
fetch-depth: 1

.github/actions/get-mathlib-ci/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ runs:
3333
using: composite
3434
steps:
3535
- name: Get mathlib-ci
36-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
36+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
3737
with:
3838
repository: leanprover-community/mathlib-ci
3939
ref: ${{ inputs.ref }}

.github/actions/get-tools/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ runs:
139139
140140
- name: Checkout tools branch (source build)
141141
if: ${{ steps.finalize.outputs.result == 'build' }}
142-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
142+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
143143
with:
144144
ref: ${{ inputs.tools_source_ref }}
145145
path: ${{ inputs.path }}

.github/actions/setup-build-env/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ runs:
6464
# code we build, so don't leave the GITHUB_TOKEN in pr-branch/.git/config where
6565
# that code could read it.
6666
- name: Checkout PR branch
67-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
67+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
6868
with:
6969
ref: ${{ inputs.pr_branch_ref }}
7070
fetch-depth: 1

.github/workflows/PR_summary.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,19 @@ jobs:
1717

1818
steps:
1919
- name: Checkout code
20-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
20+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
2121
with:
2222
ref: ${{ github.event.pull_request.head.sha }}
2323
fetch-depth: 0
2424
path: pr-branch
2525
# Untrusted (potentially fork) checkout: don't persist the GITHUB_TOKEN into its .git/config.
2626
persist-credentials: false
27+
# Only trusted base-repo scripts run against this checkout, so checking out
28+
# fork PR code under pull_request_target is safe.
29+
allow-unsafe-pr-checkout: true
2730

2831
- name: Checkout local actions
29-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
32+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
3033
with:
3134
ref: ${{ github.workflow_sha }}
3235
fetch-depth: 1

.github/workflows/actionlint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout
12-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
12+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
1313

1414
- name: suggester / actionlint
1515
uses: reviewdog/action-actionlint@6fb7acc99f4a1008869fa8a0f09cfca740837d9d # v1.72.0
@@ -21,7 +21,7 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Checkout
24-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
24+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
2525

2626
# Using our fork's PR branch until upstream merges the improved error reporting:
2727
# https://github.com/zgosalvez/github-actions-ensure-sha-pinned-actions/pull/288

.github/workflows/add_label_from_diff.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
if: github.repository == 'leanprover-community/mathlib4'
2323
steps:
2424
- name: Checkout master branch to build autolabel from
25-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
25+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
2626
with:
2727
ref: master
2828
path: tools
@@ -38,13 +38,16 @@ jobs:
3838
run: |
3939
lake build autolabel
4040
- name: Checkout branch to label
41-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
41+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
4242
with:
4343
ref: ${{ github.event.pull_request.head.sha || github.sha }}
4444
fetch-depth: 0
4545
path: pr-branch
4646
# Untrusted (potentially fork) checkout: don't persist the GITHUB_TOKEN into its .git/config.
4747
persist-credentials: false
48+
# autolabel is built from the trusted base checkout and only reads these files,
49+
# so checking out fork PR code under pull_request_target is safe.
50+
allow-unsafe-pr-checkout: true
4851
- name: Run autolabel
4952
working-directory: pr-branch
5053
run: |

.github/workflows/build_template.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
# We just populate the env vars for this step to make them viewable in the logs
8080
8181
- name: Checkout local actions
82-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
82+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
8383
with:
8484
ref: ${{ github.workflow_sha }}
8585
fetch-depth: 1
@@ -394,7 +394,7 @@ jobs:
394394
shell: landrun --rox /usr --ro /etc/timezone --rw /dev --rox /home/lean/.elan --rox /home/lean/actions-runner/_work --rox /home/lean/.cache/mathlib/ --rw pr-branch/.lake/ --env PATH --env HOME --env GITHUB_OUTPUT --env CI -- bash -euxo pipefail {0}
395395
steps:
396396
- name: Checkout local actions
397-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
397+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
398398
with:
399399
ref: ${{ github.workflow_sha }}
400400
fetch-depth: 1
@@ -604,7 +604,7 @@ jobs:
604604
# `build_template` via `pull_request_target`, never this one — so
605605
# `pr_branch_ref` is always a trusted ref here. Fork PRs keep `master`.
606606
- name: Checkout tools branch
607-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
607+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
608608
with:
609609
ref: ${{ inputs.tools_branch_ref != '' && inputs.tools_branch_ref || (github.event.pull_request.head.repo.fork && 'master' || inputs.pr_branch_ref) }}
610610
fetch-depth: 1
@@ -674,7 +674,7 @@ jobs:
674674
contents: read
675675
steps:
676676

677-
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
677+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
678678
with:
679679
ref: ${{ inputs.pr_branch_ref }}
680680
# Untrusted (potentially fork) checkout: don't persist the GITHUB_TOKEN into its .git/config.
@@ -684,7 +684,7 @@ jobs:
684684
# below loads from a trust-rooted source, not from PR-branch-controlled
685685
# content. Mirrors the `Checkout local actions` step in the `build` job.
686686
- name: Checkout local actions
687-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
687+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
688688
with:
689689
ref: ${{ github.workflow_sha }}
690690
fetch-depth: 1
@@ -748,7 +748,7 @@ jobs:
748748
lake exe graph
749749
750750
- name: Checkout local actions
751-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
751+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
752752
with:
753753
ref: ${{ github.workflow_sha }}
754754
fetch-depth: 1

.github/workflows/cache_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
run:
4242
shell: bash
4343
steps:
44-
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
44+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
4545

4646
# Install elan and the toolchain cross-platform. Build/test/lint, the
4747
# Mathlib cache, and the GitHub cache are all disabled, so this is a

.github/workflows/check_pr_titles.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout
22-
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
22+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
2323
with:
2424
ref: master
2525
- name: Configure Lean

0 commit comments

Comments
 (0)