fix(ci): never claim :latest on a manual docker-publish run#2316
Merged
Conversation
`github.event.release.prerelease` only exists on the `release` webhook payload. On `workflow_dispatch` it renders as an empty string, which sails past the bare `!= "true"` check -- so any manual run pushed `lfenergy/flexmeasures:latest` alongside the requested tag, silently overwriting the stable image with whatever was built. Gate the `latest` tag on the event being a `release`, and add an opt-in `latest` input so the documented "re-run a stable release" path still works. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: F.N. Claessen <felix@seita.nl>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: F.N. Claessen <felix@seita.nl>
Documentation build overview
|
Signed-off-by: Felix Claessen <30658763+Flix6x@users.noreply.github.com>
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.
Problem
docker-publish.ymldecides whether to also pushlfenergy/flexmeasures:latestwith:github.event.release.prereleaseonly exists on thereleasewebhook payload. Onworkflow_dispatchthere is no release payload, so the expression renders as an empty string,[ "" != "true" ]is true, and the run pushes:latestalongside the requested tag — silently overwriting the stable image with whatever was manually built.That makes the manual-dispatch path documented in
release_process.rstunsafe for anything but a stable release.Fix
latesttag ongithub.event_name == 'release', so a dispatch never claims it implicitly.latestboolean input (defaultfalse) so the documented "re-run a stable release" path still works.release_process.rst, including the easy-to-miss detail thatworkflow_dispatchreads the workflow file from the ref picked in the "Use workflow from" dropdown, while thetaginput decides which ref is checked out and built.Behaviour
latestinputrelease:v0.33.1+:latestrelease:v0.34.0rc1workflow_dispatch:v0.34.0rc1workflow_dispatch:v0.33.1+:latestBefore this change, row 3 also pushed
:latest.Context
Found while preparing a pre-release image for a downstream plugin, which needs exactly the dispatch path in row 3.
🤖 Generated with Claude Code