Skip to content

Commit cff08e9

Browse files
committed
Merge branch 'master' into tb_ref9484
2 parents 33ac51f + 97f1212 commit cff08e9

58 files changed

Lines changed: 629 additions & 191 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/PR_summary.yml

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

1818
steps:
1919
- name: Checkout code
20-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
20+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
2121
with:
2222
ref: ${{ github.event.pull_request.head.sha }}
2323
fetch-depth: 0
@@ -26,7 +26,7 @@ jobs:
2626
persist-credentials: false
2727

2828
- name: Checkout local actions
29-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
29+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
3030
with:
3131
ref: ${{ github.workflow_sha }}
3232
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
12+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
24+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
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: 2 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
25+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
2626
with:
2727
ref: master
2828
path: tools
@@ -38,7 +38,7 @@ jobs:
3838
run: |
3939
lake build autolabel
4040
- name: Checkout branch to label
41-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
41+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
4242
with:
4343
ref: ${{ github.event.pull_request.head.sha || github.sha }}
4444
fetch-depth: 0

.github/workflows/bors.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ jobs:
3030
# Use the MASTER cache key only when merging into mathlib4 (staging branch);
3131
# 'bors try' runs (trying branch) and nightly-testing use NON_MASTER
3232
cache_application_id: ${{ github.ref_name == 'staging' && github.repository == 'leanprover-community/mathlib4' && vars.CACHE_MASTER_WRITER_AZURE_APP_ID || vars.CACHE_NON_MASTER_WRITER_AZURE_APP_ID }}
33+
# Track the cache_application_id choice above; the environment fixes the OIDC subject the Azure app trusts.
34+
# nightly-testing is intentionally left without an environment ('') so it keeps its existing ref-based trust.
35+
# TODO: give mathlib4-nightly-testing its own cache-upload environment + federated credential.
36+
cache_environment: ${{ github.repository == 'leanprover-community/mathlib4' && (github.ref_name == 'staging' && 'cache-upload-master' || 'cache-upload-forks') || '' }}
3337
# bors runs should build the tools from their commit-under-test: after all, we are trying to
3438
# test 'what would happen if this was merged', so we need to use the 'would-be-post-merge' tools
3539
tools_branch_ref: ${{ github.sha }}

.github/workflows/build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,9 @@ jobs:
3737
pr_branch_ref: ${{ github.sha }}
3838
# Use the MASTER cache key only on mathlib4/master; nightly-testing and other branches use NON_MASTER
3939
cache_application_id: ${{ github.repository == 'leanprover-community/mathlib4' && github.ref == 'refs/heads/master' && vars.CACHE_MASTER_WRITER_AZURE_APP_ID || vars.CACHE_NON_MASTER_WRITER_AZURE_APP_ID }}
40+
# Track the cache_application_id choice above; the environment fixes the OIDC subject the Azure app trusts.
41+
# nightly-testing is intentionally left without an environment ('') so it keeps its existing ref-based trust.
42+
# TODO: give mathlib4-nightly-testing its own cache-upload environment + federated credential.
43+
cache_environment: ${{ github.repository == 'leanprover-community/mathlib4' && (github.ref == 'refs/heads/master' && 'cache-upload-master' || 'cache-upload-forks') || '' }}
4044
runs_on: pr
4145
secrets: inherit

.github/workflows/build_fork.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@ jobs:
3737
concurrency_group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
3838
pr_branch_ref: ${{ github.event.pull_request.head.sha }}
3939
cache_application_id: ${{ vars.CACHE_NON_MASTER_WRITER_AZURE_APP_ID }}
40+
cache_environment: cache-upload-forks
4041
runs_on: pr
4142
secrets: inherit

.github/workflows/build_template.yml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ on:
2727
cache_application_id:
2828
type: string
2929
required: true
30+
cache_environment:
31+
# GitHub environment for the `upload_cache` job. Its only role is to fix the
32+
# OIDC `sub` claim to `...:environment:<name>`, which the Azure cache app's
33+
# federated credential is scoped to; it must match the writer `cache_application_id`.
34+
type: string
35+
required: true
3036

3137
env:
3238
# Disable Lake's automatic fetching of cloud builds.
@@ -89,7 +95,7 @@ jobs:
8995

9096
# Checkout a trusted branch to build the tooling from
9197
- name: Checkout tools branch
92-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
98+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
9399
with:
94100
# Recall that on the `leanprover-community/mathlib4-nightly-testing` repository,
95101
# we don't maintain a `master` branch at all.
@@ -99,7 +105,7 @@ jobs:
99105
path: tools-branch
100106

101107
- name: Checkout local actions
102-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
108+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
103109
with:
104110
ref: ${{ github.workflow_sha }}
105111
fetch-depth: 1
@@ -122,7 +128,7 @@ jobs:
122128

123129
# Checkout the PR branch into a subdirectory
124130
- name: Checkout PR branch
125-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
131+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
126132
with:
127133
ref: ${{ inputs.pr_branch_ref }}
128134
fetch-depth: 2 # we may fetch cache from the commit before this one (or earlier)
@@ -577,7 +583,7 @@ jobs:
577583
- name: Generate lean-pr-testing app token
578584
if: ${{ always() && github.repository == 'leanprover-community/mathlib4-nightly-testing' && (startsWith(github.ref_name, 'lean-pr-testing-') || startsWith(github.ref_name, 'batteries-pr-testing-')) }}
579585
id: lean-pr-testing-token
580-
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
586+
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
581587
with:
582588
# `batteries-pr-testing-*` branches need a token scoped to `leanprover-community/batteries`
583589
# for the labelling API; `lean-pr-testing-*` branches need one scoped to `leanprover/lean4`.
@@ -608,6 +614,10 @@ jobs:
608614
name: Upload to cache
609615
needs: [build]
610616
runs-on: ubuntu-latest # These steps run on a GitHub runner; no landrun sandboxing is needed.
617+
# Pins the OIDC `sub` claim to `...:environment:<cache_environment>`, which the Azure cache
618+
# app's federated credential is scoped to. A token minted by any job without this environment
619+
# (e.g. the untrusted build/post_steps/style_lint jobs) cannot satisfy that trust.
620+
environment: ${{ inputs.cache_environment }}
611621
permissions:
612622
contents: read
613623
id-token: write
@@ -617,7 +627,7 @@ jobs:
617627
if: ${{ always() && needs.build.outputs.cache-staging-has-files == 'true' }}
618628
steps:
619629
- name: Checkout tools branch
620-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
630+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
621631
with:
622632
ref: ${{ inputs.tools_branch_ref != '' && inputs.tools_branch_ref || (github.repository == 'leanprover-community/mathlib4-nightly-testing' && 'nightly-testing-green' || 'master') }}
623633
fetch-depth: 1
@@ -693,7 +703,7 @@ jobs:
693703
contents: read
694704
steps:
695705

696-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
706+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
697707
with:
698708
ref: ${{ inputs.pr_branch_ref }}
699709
# Untrusted (potentially fork) checkout: don't persist the GITHUB_TOKEN into its .git/config.
@@ -743,7 +753,7 @@ jobs:
743753
lake exe graph
744754
745755
- name: Checkout local actions
746-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
756+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
747757
with:
748758
ref: ${{ github.workflow_sha }}
749759
fetch-depth: 1
@@ -908,7 +918,7 @@ jobs:
908918
steps.get-label-actor.outputs.username != 'mathlib-update-dependencies' &&
909919
steps.get-label-actor.outputs.username != 'mathlib-splicebot'
910920
name: check team membership
911-
uses: tspascoal/get-user-teams-membership@818140d631d5f29f26b151afbe4179f87d9ceb5e # v4.0.1
921+
uses: tspascoal/get-user-teams-membership@b2546c5affc730fd8e3d8483ae9ad3621938c2f9 # v4.0.2
912922
id: actorTeams
913923
with:
914924
organization: leanprover-community # optional. Default value ${{ github.repository_owner }}
@@ -927,7 +937,7 @@ jobs:
927937
contains(steps.actorTeams.outputs.teams, 'bot-users')
928938
)
929939
name: If `auto-merge-after-CI` is present, add a `bors merge` comment.
930-
uses: GrantBirki/comment@608e41b19bc973020ec0e189ebfdae935d7fe0cc # v2.1.1
940+
uses: GrantBirki/comment@3439715f0cf3b8fc29bf47be0e3226679c06c41a # v3.0.0
931941
with:
932942
# This token is masked by the token minting action and will not be logged accidentally.
933943
token: ${{ steps.auto-merge-app-token.outputs.token }}

.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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
22+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
2323
with:
2424
ref: master
2525
- name: Configure Lean

.github/workflows/ci_dev.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,6 @@ jobs:
4646
run_post_ci: ${{ inputs.run_post_ci }}
4747
mathlib_ci_ref: ${{ inputs.mathlib_ci_ref }}
4848
cache_application_id: ${{ vars.CACHE_NON_MASTER_WRITER_AZURE_APP_ID }}
49+
cache_environment: cache-upload-forks
4950
runs_on: pr
5051
secrets: inherit

.github/workflows/commit_verification.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ jobs:
3333
# This is a quick check to avoid unnecessary runs
3434
steps:
3535
- name: Checkout PR head
36-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
36+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
3737
with:
3838
# Checkout the actual PR head, not the merge commit GitHub creates
3939
ref: ${{ github.event.pull_request.head.sha }}
4040
# Fetch full history to access all PR commits
4141
fetch-depth: 0
4242
- name: Checkout local actions
43-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
43+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
4444
with:
4545
ref: ${{ github.workflow_sha }}
4646
fetch-depth: 1

0 commit comments

Comments
 (0)