ci: only publish the Docker image from master - #12
Merged
Merged
Conversation
main.yml triggered on push to every branch (branches: "*"), so any branch push rebuilt and overwrote braunbearded/python-dvr:latest on Docker Hub. Scope the trigger to master so :latest tracks master only; workflow_dispatch stays for manual runs.
PR Summary by QodoRestrict automatic Docker image publishing to master
AI Description
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1.
|
Address review: the push branch filter alone did not cover workflow_dispatch, so a manual run selecting a feature branch would still publish and overwrite :latest. Gate the docker job on github.ref == refs/heads/master so only master publishes, regardless of how the workflow is triggered.
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.
main.ymltriggered on push to every branch:Since it builds and pushes
braunbearded/python-dvr:latestunconditionally, any push to any branch rebuilt and overwrote:lateston Docker Hub with that branch's code — a footgun.This scopes the trigger to
master, so:latesttracksmasteronly.workflow_dispatchis kept for manual runs, and the per-commit:${{ github.sha }}tag is unchanged.No functional change to the image itself.