ci: check out reusable workflow's own actions at the called ref - #141
Merged
Conversation
BridgeAR
marked this pull request as ready for review
June 23, 2026 12:28
build.yml pinned its own compute-matrix, platforms, prebuild, and test actions to a fixed commit. Every change to those actions then needed a manual re-pin, and a consumer that pinned build.yml at revision X still ran the composite actions from the commit hard-coded inside it, not X — the repo's own Test workflow included, which exercised the pinned actions instead of the revision under test. Each job now checks out the workflow's own repository at job.workflow_sha and runs the actions by local path, so the composite logic always matches the build.yml revision actually invoked and never needs a manual bump.
BridgeAR
force-pushed
the
BridgeAR/2026-06-23-build-yml-self-checkout
branch
from
June 23, 2026 13:12
a92ce7e to
9320d33
Compare
szegedi
reviewed
Jun 24, 2026
szegedi
left a comment
Contributor
There was a problem hiding this comment.
I like it, but would like to also understand how is e.g ./.prebuildify/compute-matrix safe when DataDog/action-prebuildify/compute-matrix@main isn't?
szegedi
approved these changes
Jun 24, 2026
The build and test jobs check out two repositories: the calling repository and action-prebuildify into .prebuildify. Both used a bare actions/checkout, so the two steps read as a duplicate. Name each so its purpose is clear.
The self-checkout commit accidentally reverted the merge step from v7.0.1 to v6.0.0. Pin it back to the version on main.
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
build.ymlpinned its owncompute-matrix,platforms,prebuild, andtestactions to a fixed commit, so each change to them needed a manual re-pin (e.g. #136), and a consumer pinningbuild.yml@Xstill ran the composite actions from the commit hard-coded inside it, not X. Each job now checks out the workflow's own repo atjob.workflow_shaand runs the actions by local path — no manual bump.Why
build.yml@Xnow runs exactly the actions that shipped with X../refs are exempt from the SHA-pin supply-chain policy, so no allowlist/config change is needed.Testworkflow now exercises the PR's own actions (job.workflow_sha= PR head) instead of a stale pinned commit.Test plan
Testworkflow green across all platforms / the Node matrix (it calls./.github/workflows/build.yml, exercising the self-checkout path directly).DataDog/action-prebuildify/.github/workflows/build.yml@<this-sha>resolves prebuilds/tests — the self-test can't prove the external-consumer path on its own (there the consumer repo is action-prebuildify).Note:
job.workflow_*is GA (runner >= v2.334, Apr 2026); GitHub-hosted runners only, which is all this repo uses.Out of scope: the composite actions still tag-pin their third-party deps (
actions/download-artifact@v7,actions/cache@v5,actions/upload-artifact@v6,actions/[email protected]) — a separate supply-chain item.