workflows: check out v22.21.1 so Dockerfile.Packages is present#19
Merged
harshita-gupta merged 1 commit intomainfrom Apr 21, 2026
Merged
Conversation
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>
skeggse
approved these changes
Apr 21, 2026
Member
skeggse
left a comment
There was a problem hiding this comment.
approving with the expectation that we close this hole soon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the
build-node-packages.ymlworkflow to actually work when dispatched frommain.The problem:
actions/checkout@v3defaults to checking out the ref that triggered the workflow. When dispatched frommain, it pullsmain— butDockerfile.Packagesand the Node source tree only live on thev22.21.1branch, so thedocker buildstep fails with:This was always the case but didn't surface until PR #17 added the S3 upload, because the
refs/heads/mainOIDC gate forced dispatch frommain. Under the originalworkflow_runtrigger (which runs onv22.21.1), the default checkout happened to grab the right tree.The fix: pin
ref: \${{ env.NODE_VERSION }}(=v22.21.1) on the checkout step. This only affects what gets placed into$GITHUB_WORKSPACE; the workflow YAML itself still executes from whichever ref triggered it, soworkflow_ref(the OIDC subject claim) remains...@refs/heads/mainand thepush_node_gyp_packagesIAM role gate still works.Known security hole (flagged for follow-up)
v22.21.1is not a protected branch. In principle, any of the repo's ~530 collaborators could push a maliciousDockerfile.Packagesto this branch and have the workflow build+upload the resulting tarballs to our public S3 cache.This change does not expand the attack surface. The same ~530 collaborators can already modify the Node source tree on this branch, which is what we compile into the released binaries. The Dockerfile is a lesser attack target than the source itself.
Why we're shipping this anyway:
push_node_gyp_packages) still requiresrefs/heads/mainOIDC, so the workflow YAML itself can only be modified throughmain(which IS protected).A follow-up PR will propose a structural fix — options under consideration:
v22.21.1and other active Node version branchesnodejs/nodedirectly via submodule, keeping Asana patches in a small forkTracked in internal project notes on the Asana/node fork's structural issues.
Test plan
mainvia the Actions UI.ref: v22.21.1in its logs.packages_x64.tar.gzandpackages_arm64.tar.gzupload tos3://asana-oss-cache/node-gyp/.🤖 Generated with Claude Code