Skip to content

Checkout spel's own source in reusable build workflow - #840

Merged
lorengordon merged 2 commits into
plus3it:masterfrom
lorengordon:fix/reusable-workflow-checkout-source
Sep 29, 2026
Merged

lorengordon merged 2 commits into
plus3it:masterfrom
lorengordon:fix/reusable-workflow-checkout-source

Conversation

@lorengordon

@lorengordon lorengordon commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Problem

When build.yml is invoked as a reusable workflow via workflow_call from another repository (e.g. amigen9), the bare actions/checkout steps in the build and release-pr jobs default to checking out ${{ github.repository }}@${{ github.sha }}. In a workflow_call context, those default context values resolve to the calling repository/ref (e.g. amigen9), not spel's own.

This caused CI failures such as:

make: Makefile.spel: No such file or directory
make: *** No rule to make target 'Makefile.spel'.  Stop.

because Makefile.spel only exists in spel's own repository.

The release-pr job has the same bug: it would attempt to move manifests into and open a PR against whatever repo happened to invoke the workflow, rather than spel's own manifests/ directory and .bumpversion.cfg.

Fix

Pin both checkout steps to job.workflow_repository / job.workflow_sha, which per GitHub's contexts reference always resolve to the repository and commit that define the current job (i.e. spel's own build.yml), regardless of which repository or ref invoked the workflow. This is GitHub's documented pattern for reusable workflows that need to access files co-located with the workflow definition.

The manifests job is unaffected since it only merges uploaded artifacts and has no checkout step.

When build.yml is invoked as a reusable workflow via workflow_call from
another repo (e.g. amigen9), a bare actions/checkout step defaults to
checking out the CALLER's repository and sha, not spel's own. This broke
the build job (Makefile.spel: No such file or directory) and would break
release-pr (missing manifests/ dir, .bumpversion.cfg, etc).

Fix by pinning checkout to job.workflow_repository/job.workflow_sha, which
always resolve to the repo/commit defining the current job, regardless of
which repo/ref invoked the workflow.
@lorengordon
lorengordon requested a review from a team September 28, 2026 16:13
@mergify

mergify Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@lorengordon
lorengordon merged commit e47e6d4 into plus3it:master Sep 29, 2026
9 checks passed
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