fix: convert from reusable workflow to composite action#2
Merged
Conversation
The v1.0.0 reusable workflow used a two-checkout pattern with
${{ github.workflow_ref }} to pull in its own scripts. That context
variable — inside a reusable workflow — resolves to the CALLER's workflow
ref, not the callee's, which produces an invalid git refspec when fed
to actions/checkout as 'ref:'. The pattern cannot work: there is no
reusable-workflow context that exposes the caller's pinned ref back to
the callee.
Composite actions have ${{ github.action_path }} which is the canonical
way to ship scripts alongside an action. Caller boilerplate grows slightly
(own checkout + uses: step) but the form is structurally sound.
Breaking API changes from v1.0.0:
- Caller syntax: jobs.foo.uses: -> jobs.foo.steps[].uses: (plus own checkout)
- Secrets become inputs: secrets.GH_PAT -> inputs.gh-pat, etc.
- Still passed via ${{ secrets.FOO }} at call site for masking.
README updated for new caller syntax. Scripts unchanged. v1.0.0 and v1
tags will be force-moved to this commit; beacon's caller (currently at
broken v1 syntax) will be updated in a follow-up PR.
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.
Fixes the architectural bug in v1.0.0: reusable workflows cannot reference their own files because
${{ github.workflow_ref }}resolves to the caller's ref, not the callee's. Composite actions have${{ github.action_path }}which is the canonical way. Breaking change vs v1.0.0 API, but v1.0.0 has no external consumers.