ci: restrict release workflow to main#2187
Merged
Merged
Conversation
Contributor
Contributor
Coverage report (presidio-cli)Click to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
Contributor
Coverage report (presidio-anonymizer)Click to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the manual release workflow by ensuring releases can only be initiated from the main branch, preventing accidental publishing (GitHub releases, PyPI packages, and GHCR images) from unmerged branches or tags.
Changes:
- Adds an early “Validate release branch” step in the
get-versionjob which fails the workflow whengithub.refis notrefs/heads/main. - Ensures the workflow fails before checkout/version extraction, and blocks all downstream publishing jobs via the existing
needs: get-versiondependency chain.
Contributor
Coverage report (presidio-image-redactor)Click to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||
Contributor
Coverage report (presidio-analyzer)Click to see where and how coverage changed
The report is truncated to 25 files out of 72. To see the full report, please visit the workflow summary page. This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SharonHart
approved these changes
Jul 22, 2026
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.
Summary
Restricts the manually triggered release workflow to the
mainbranch.workflow_dispatchallows users to select the ref from which the workflow runs. Previously, selecting another branch or tag could publish Python packages and container images built from code that had not been merged intomain.This change adds an early validation step to the
get-versionjob. The workflow fails before checkout and version extraction when the selected ref is notrefs/heads/main.Since all publishing jobs depend directly or indirectly on
get-version, the validation prevents:mainrefmainrefmainrefTesting
mainproceeds normally.Validate release branchstep before any artifacts are published.