Accept an explicit tag on the reusable (workflow_call) path#3
Conversation
The reusable workflow only accepted `force`, so a caller could not tell it which release to publish; with no tag it fell through to `gh release view` (the latest published release). That endpoint excludes pre-releases and lags a just-promoted release, so a caller invoking this mid-promotion could resolve the previous version and publish the wrong apt package (or skip), with the run still green. Add a `tag` input to the workflow_call signature and read the tag from the `inputs` context (which covers both the reusable and manual paths). When the caller passes the release it is promoting, version resolution no longer depends on GitHub's eventually-consistent "latest release" lookup. Behavior is unchanged when no tag is provided (still falls back to latest).
ElFantasma
left a comment
There was a problem hiding this comment.
The change here is correct and the right root-cause fix (resolve from inputs.tag instead of the lagging gh release view). One coordination note, though: this is inert until the caller passes tag, and the caller currently doesn't.
ethrex#6920 is already merged, and its publish-apt job in .github/workflows/tag_latest.yaml calls this workflow without a with: block:
publish-apt:
needs: [retag_docker_images]
uses: lambdaclass/ethrex-apt/.github/workflows/publish-apt.yml@main
secrets: { … } # no `with: { tag: … }`So after this PR merges, inputs.tag stays at its "" default → the workflow still falls through to gh release view → the exact lagging-"latest" race this PR is meant to remove. The apt half of the v18 breakage isn't closed yet.
Needs a follow-up in ethrex to actually pass the tag — the resolve job already exposes it:
publish-apt:
needs: [resolve, retag_docker_images]
uses: lambdaclass/ethrex-apt/.github/workflows/publish-apt.yml@main
with:
tag: ${{ needs.resolve.outputs.new_tag }} # normalizes 18.0.0 / v18.0.0
secrets: { … }Merge order: this PR should land first; only then can the ethrex caller pass with: { tag: … } (since it pins @main, passing an input that doesn't exist yet would fail the call with "invalid input 'tag'").
Net: this PR is a correct prerequisite, but the apt path stays on the racy fallback until the ethrex publish-apt caller is updated to pass tag.
Motivation
The reusable
publish-apt.yml(workflow_call) only accepted aforceinput — there was no way for a caller to say which release to publish. With no tag, it always fell through togh release view, which resolves GitHub's latest published, non-pre-release release. That lookup excludes pre-releases and lags a just-promoted release, so a caller that invokes this workflow at promotion time can resolve the previous version and publish the wrong.deb(or skip via the pool check), while the run stays green.Description
taginput to theworkflow_callsignature (string, optional, default""), mirroring the existingworkflow_dispatchtaginput.inputscontext (inputs.tag), which is populated for both the reusable and manual paths, instead ofgithub.event.inputs.tag(manual only).This lets the ethrex release workflow pass the exact release it is promoting, so apt version resolution no longer depends on GitHub's eventually-consistent "latest release" lookup. Normalization already handles both
18.0.0andv18.0.0forms.How to test
tag=18.0.0→ builds/publishes18.0.0.uses:this workflow withwith: { tag: 18.0.0 }→ publishes18.0.0regardless of whatgh release viewcurrently reports.