fix(ci): publish semver Docker tags on automated releases - #77
Merged
Conversation
Tags pushed by release.yml use the default GITHUB_TOKEN, and GitHub suppresses workflow triggers for such pushes to prevent recursion. The tags: ["v*.*.*"] trigger on docker-publish.yml therefore never fired for an automated release, so no versioned image was ever published. Expose the new tag as a job output and have release.yml invoke docker-publish.yml through workflow_call, passing the version explicitly so metadata-action resolves semver from the input instead of the ref. Drop the main branch push trigger from docker-publish.yml: release.yml already runs on every main push, and keeping both would build the image twice and race on the latest, main and sha- tags. Closes #76
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The reusable Docker workflow references inputs.version on non-workflow_call events, which can break push/pull_request runs unless the access is gated.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
This PR fixes automated releases not publishing semantic-version Docker tags by switching Docker publishing from a tag-triggered workflow to a reusable workflow invoked directly from the release workflow.
Changes:
- Expose the newly created tag as an output from
release.yml’screate-tagjob and call the Docker publish workflow with that version. - Add
workflow_callsupport todocker-publish.ymland wire semver tag generation to an optionalversioninput. - Remove the
push.branches: [main]trigger fromdocker-publish.ymlto avoid duplicate publish runs onmain.
File summaries
| File | Description |
|---|---|
| .github/workflows/release.yml | Exposes the created tag as a job output and invokes the Docker publish workflow with that semver tag. |
| .github/workflows/docker-publish.yml | Adds workflow_call input for versioned publishing and updates metadata-action tag generation accordingly. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
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.
Closes #76
Root cause
The reported cause (a bad
tags: ["v*.*.*"]glob) is not the problem — that pattern is valid, and there is exactly one tag-triggered run in the repo's history (v0.3.0, 2025-09-12) which was a hand-pushed tag. As @ThibaultNocchi identified in their follow-up comment, the real cause is different.release.ymlpushes the release tag using the defaultGITHUB_TOKEN. GitHub deliberately suppresses workflow triggers for pushes made with that token to prevent recursive runs, sodocker-publish.yml's tag trigger never fired for an automated release. Across the last 100docker-publish.ymlruns, every ref is a branch or a PR — the automatedv0.2.xtags produced zero runs.Fix
docker-publish.ymlnow acceptsworkflow_callwith an optionalversioninput, andrelease.ymlinvokes it directly after creating the tag. No new secrets or tokens are required.metadata-action'sprocSemverresolves the version three ways, which lets a singlevalue=${{ inputs.version }}cover every trigger path without duplicatedenable=guards:Invalid input only emits
core.warning, so it can never fail a build.Resulting tags
mainlatest,main,0.3.1,0.3,sha-xxxxxxxpush: false)1.0.0,1.0,sha-xxxxxxxworkflow_dispatchNote on the removed
mainbranch triggerbranches: ["main"]was dropped fromdocker-publish.yml.release.ymlalready runs on every push tomain, so keeping both triggers would run two full multi-arch (amd64 + arm64) builds per push, racing to write the samelatest,mainandsha-tags.The tradeoff: image publishing now depends on the
create-tagjob succeeding. Restoring that single line brings back an independentmainbuild if you would rather keep it as a safety net.Verification
actionlintv1.7.12 — exit 0, clean (it validates the caller'swith:against the callee's declared inputs)semver.valid('v0.3.1')→0.3.1, rendering{{version}}=0.3.1and{{major}}.{{minor}}=0.3;'main'and''→null(skipped)Not verifiable before merge: an actual live run, since the
workflow_callwiring only exercises once this is onmain.