Skip to content

ci: check out reusable workflow's own actions at the called ref - #141

Merged
BridgeAR merged 3 commits into
mainfrom
BridgeAR/2026-06-23-build-yml-self-checkout
Jun 24, 2026
Merged

ci: check out reusable workflow's own actions at the called ref#141
BridgeAR merged 3 commits into
mainfrom
BridgeAR/2026-06-23-build-yml-self-checkout

Conversation

@BridgeAR

Copy link
Copy Markdown
Member

Summary

build.yml pinned its own compute-matrix, platforms, prebuild, and test actions to a fixed commit, so each change to them needed a manual re-pin (e.g. #136), and a consumer pinning build.yml@X still ran the composite actions from the commit hard-coded inside it, not X. Each job now checks out the workflow's own repo at job.workflow_sha and runs the actions by local path — no manual bump.

Why

  • Removes the recurring self-reference re-pin chore (alternative to Pin action self-references to latest main #136).
  • Tightens reproducibility: build.yml@X now runs exactly the actions that shipped with X.
  • Local ./ refs are exempt from the SHA-pin supply-chain policy, so no allowlist/config change is needed.
  • Fixes self-test fidelity: the Test workflow now exercises the PR's own actions (job.workflow_sha = PR head) instead of a stale pinned commit.

Test plan

  • Test workflow green across all platforms / the Node matrix (it calls ./.github/workflows/build.yml, exercising the self-checkout path directly).
  • Cross-repo smoke: a dd-trace-js branch pinned at 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.

@BridgeAR
BridgeAR marked this pull request as ready for review June 23, 2026 12:28
@BridgeAR
BridgeAR requested a review from a team as a code owner 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
BridgeAR force-pushed the BridgeAR/2026-06-23-build-yml-self-checkout branch from a92ce7e to 9320d33 Compare June 23, 2026 13:12

@szegedi szegedi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment thread .github/workflows/build.yml Outdated
Comment thread .github/workflows/build.yml Outdated
Comment thread .github/workflows/build.yml Outdated
Comment thread .github/workflows/build.yml Outdated
Comment thread .github/workflows/build.yml Outdated
Comment thread .github/workflows/build.yml Outdated
Comment thread .github/workflows/build.yml Outdated
Comment thread .github/workflows/build.yml Outdated
Comment thread .github/workflows/build.yml Outdated
Comment thread .github/workflows/build.yml Outdated
BridgeAR added 2 commits June 24, 2026 13:41
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.
@BridgeAR
BridgeAR merged commit 7e71e41 into main Jun 24, 2026
137 checks passed
@BridgeAR
BridgeAR deleted the BridgeAR/2026-06-23-build-yml-self-checkout branch June 24, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants