Skip to content

Guard release publish against non-default-ref dispatch mis-versioning - #184

Merged
ptr727 merged 2 commits into
developfrom
fix-publish-dispatch-and-resync-doc-defects
Jun 23, 2026
Merged

Guard release publish against non-default-ref dispatch mis-versioning#184
ptr727 merged 2 commits into
developfrom
fix-publish-dispatch-and-resync-doc-defects

Conversation

@ptr727

Copy link
Copy Markdown
Owner

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#183
Fixes#182
Fixes#181

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
CopilotAI review requested due to automatic review settings June 22, 2026 23:59

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.yml when workflow_dispatch runs on a ref other than the repo default branch.
  • Add a publish-time safety check in build-release-task.yml to refuse publishing a main release if SemVer2 looks like a prerelease.
  • Minor maintenance: correct JSON/JSONC casing in .editorconfig and 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.

FileDescription
.github/workflows/publish-release.ymlAdds a dispatch-ref guard to prevent cross-leg version mis-detection in the branch matrix.
.github/workflows/build-release-task.ymlAdds a main-release version sanity check before creating a GitHub Release.
.github/workflows/build-pypilibrary-task.ymlClarifies the PEP 440 ordering comment to note the transient post-promotion exception.
.editorconfigFixes JSON/JSONC casing in the section comment.

Comment thread.github/workflows/publish-release.yml Outdated
Comment thread.github/workflows/build-release-task.yml Outdated
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.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@ptr727
ptr727 merged commit c30db2a into developJun 23, 2026
9 checks passed
@ptr727
ptr727 deleted the fix-publish-dispatch-and-resync-doc-defects branch June 23, 2026 00:06
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>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@ptr727