Skip to content

fix: convert from reusable workflow to composite action#2

Merged
nerdalytics merged 1 commit into
trunkfrom
fix/composite-action
Apr 20, 2026
Merged

fix: convert from reusable workflow to composite action#2
nerdalytics merged 1 commit into
trunkfrom
fix/composite-action

Conversation

@nerdalytics

Copy link
Copy Markdown
Owner

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.

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.
@nerdalytics nerdalytics merged commit 29928de into trunk Apr 20, 2026
3 checks passed
@nerdalytics nerdalytics deleted the fix/composite-action branch April 20, 2026 18:54
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.

1 participant