Skip to content

ci: extract GHCR image publish into manually-dispatchable workflow#349

Merged
jimisola merged 2 commits intomainfrom
fix/ci-standalone-ghcr-publish
Apr 19, 2026
Merged

ci: extract GHCR image publish into manually-dispatchable workflow#349
jimisola merged 2 commits intomainfrom
fix/ci-standalone-ghcr-publish

Conversation

@jimisola
Copy link
Copy Markdown
Member

@jimisola jimisola commented Apr 19, 2026

Summary

  • New reusable workflow .github/workflows/publish-image.yml that publishes the reqstool image to GHCR for an explicit PyPI version.
  • Supports both workflow_call (used from release_prod.yml) and workflow_dispatch (manual republish of any past version).
  • release_prod.yml now calls this workflow on release events, passing github.event.release.tag_name as the version.
  • Tag computation switched from github.ref parsing to inputs.version. The existing !startsWith(github.ref, 'refs/tags/v0.') guard for the bare-major tag never matched (this repo uses unprefixed tags like 0.9.0); replaced with !startsWith(inputs.version, '0.'), matching the original intent.

Motivation

0.9.0's image publish failed during the release run (stale Fastly cache in pip install --dry-run, fixed for future runs in #348). Neither re-run nor workflow_dispatch on the 0.9.0 tag can recover it:

A standalone input-driven workflow sidesteps all of these.

Test plan

  • After merge, manually dispatch Publish image to GHCR with version: 0.9.0 and verify ghcr.io/reqstool/reqstool:0.9.0, :0.9, :0, :latest, :sha-<current> are pushed
  • Verify the built image runs: docker run --rm ghcr.io/reqstool/reqstool:0.9.0 reqstool --version
  • Next real release: confirm release_prod.yml → reusable publish-image.yml chain still runs end-to-end

Move the image build-and-push step out of `release_prod.yml` into a new
reusable workflow `publish-image.yml` that accepts the reqstool PyPI
version as an explicit input and supports both `workflow_call` (from
the release pipeline) and `workflow_dispatch` (for manual re-runs).

This unblocks the 0.9.0 case where the image publish failed in the
release run and cannot be recovered: re-running reuses the failed
run's state, and `workflow_dispatch` on the release tag checks out
the old (broken) workflow file. With an input-driven manual
workflow, any past published version can be re-imaged on demand.

Tag computation moves from `github.ref` parsing (which was brittle —
the repo uses unprefixed tags like `0.9.0`, so the `!startsWith(...,
'refs/tags/v0.')` guard for the bare-major tag never matched) to
`inputs.version` with a `!startsWith(inputs.version, '0.')` guard,
matching the original intent.

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
Comment thread .github/workflows/publish-image.yml Fixed
Comment thread .github/workflows/publish-image.yml Fixed
Comment thread .github/workflows/publish-image.yml Fixed
Comment thread .github/workflows/publish-image.yml Fixed
@jimisola jimisola self-assigned this Apr 19, 2026
CodeQL flagged docker/metadata-action, docker/setup-buildx-action,
docker/login-action, and docker/build-push-action as unpinned tags.
Pin each to a commit SHA matching the same major version already in
use, consistent with the pattern used for pypa/gh-action-pypi-publish
in release_prod.yml (introduced in #294).

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
@jimisola jimisola merged commit 2d006f1 into main Apr 19, 2026
6 checks passed
@jimisola jimisola deleted the fix/ci-standalone-ghcr-publish branch April 19, 2026 09: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