Skip to content

Commit 94a2291

Browse files
workflows: check out v22.21.1 so Dockerfile.Packages is present
When dispatched from main, `actions/checkout@v3` pulls main (the workflow's trigger ref) β€” but Dockerfile.Packages only lives on the v22.21.1 branch, so the Docker build step fails with "open Dockerfile.Packages: no such file or directory". Pinning `ref: ${{ env.NODE_VERSION }}` on the checkout keeps workflow_ref (OIDC subject claim) on main while giving the build access to the v22.21.1 tree. Does not expand the attack surface: the Node source already lives on the unprotected v22.21.1 branch, so any collaborator capable of modifying Dockerfile.Packages could already modify the binaries we ship. A follow-up PR will propose a structural fix. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 56b09b1 commit 94a2291

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

β€Ž.github/workflows/build-node-packages.ymlβ€Ž

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,24 @@ jobs:
3636
REPO: ${{ github.repository }}
3737

3838
steps:
39+
# Check out the v22.21.1 branch (not the workflow's default branch) so that
40+
# Dockerfile.Packages and the Node source tree are present. The workflow YAML
41+
# itself runs from whichever ref triggered it (main for workflow_dispatch, or
42+
# v22.21.1 for workflow_run) β€” that's what the OIDC subject claim binds to,
43+
# and it's how the IAM role's ref_patterns gate works. `ref:` here only
44+
# controls which tree gets checked out into $GITHUB_WORKSPACE.
45+
#
46+
# Security note: v22.21.1 is not a protected branch, so in principle any of
47+
# the repo's ~530 collaborators could push a malicious Dockerfile.Packages
48+
# and have this workflow build+upload the resulting image. That same risk
49+
# already existed for the Node source itself (which also lives on this
50+
# branch), so this change does not expand the attack surface. A follow-up
51+
# PR will propose a structural fix (branch protection, patch series, or
52+
# submodule model) β€” tracked in our internal project notes.
3953
- name: Checkout repository
4054
uses: actions/checkout@v3
55+
with:
56+
ref: ${{ env.NODE_VERSION }}
4157

4258
- name: Debug Matrix Values
4359
run: |

0 commit comments

Comments
Β (0)