Guard release publish against non-default-ref dispatch mis-versioning - #184
Merged
Merged
Conversation
Surfaced while re-syncing the PlexCleaner downstream onto the template. - publish-release.yml: fail fast when a publish is dispatched on a non-default ref; the matrix builds both branches, so a non-default dispatch mis-versions the main leg and publishes a malformed non-prerelease "Latest". - build-release-task.yml: refuse to create a main release whose SemVer2 carries a prerelease suffix (root-cause-agnostic safety net). - .editorconfig: correct JSON/JSONC casing in the section comment. - build-pypilibrary-task.yml: note the transient post-promotion exception in the PEP 440 ordering comment. Fixes#183Fixes#182Fixes#181
Contributor
There was a problem hiding this comment.
Pull request overview
Adds defense-in-depth guardrails to prevent mis-versioned "main" publishes when publish-release.yml is manually dispatched from a non-default ref, plus small comment/casing cleanups discovered during downstream re-sync.
Changes:
- Fail fast in
publish-release.ymlwhenworkflow_dispatchruns on a ref other than the repo default branch. - Add a publish-time safety check in
build-release-task.ymlto refuse publishing amainrelease ifSemVer2looks like a prerelease. - Minor maintenance: correct JSON/JSONC casing in
.editorconfigand clarify the PyPI PEP 440 ordering comment.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/publish-release.yml | Adds a dispatch-ref guard to prevent cross-leg version mis-detection in the branch matrix. |
| .github/workflows/build-release-task.yml | Adds a main-release version sanity check before creating a GitHub Release. |
| .github/workflows/build-pypilibrary-task.yml | Clarifies the PEP 440 ordering comment to note the transient post-promotion exception. |
| .editorconfig | Fixes JSON/JSONC casing in the section comment. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Review follow-up: scope the dispatch-ref note to schedule/dispatch (push builds only the pushed branch), and describe the SemVer2 check as rejecting any prerelease identifier rather than only the -g<sha> suffix.
Uh oh!
There was an error while loading. Please reload this page.
ptr727 added a commit
to ptr727/PlexCleaner
that referenced
this pull request
Jun 23, 2026
) Re-sync the upstream ProjectTemplate fixes (ptr727/ProjectTemplate#184/#185, Fixes#181/#182/#183) that resolved the publish-dispatch mis-versioning defect surfaced while re-syncing this downstream. - publish-release.yml: fail fast when a publish is dispatched on a non-default ref; the matrix builds both branches, so a non-default dispatch mis-versions the main leg and publishes a malformed non-prerelease "Latest". - build-release-task.yml: refuse to create a main release whose SemVer2 carries a prerelease suffix (root-cause-agnostic safety net). - .editorconfig: correct JSON/JSONC casing in the section comment. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 23, 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 freeto 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.
Surfaced while re-syncing the PlexCleaner downstream onto the template.
publish-release.yml: fail fast when a publish is dispatched on a non-default ref; the matrix builds both branches, so a non-default dispatch mis-versions the main leg and publishes a malformed non-prerelease "Latest".build-release-task.yml: refuse to create a main release whoseSemVer2carries a prerelease suffix (root-cause-agnostic safety net)..editorconfig: correct JSON/JSONC casing in the section comment.build-pypilibrary-task.yml: note the transient post-promotion exception in the PEP 440 ordering comment.Fixes#183
Fixes#182
Fixes#181