🌟 [Major]: Release decisions use owned labels - #109
🌟 [Major]: Release decisions use owned labels#109Marius Storhaug (MariusStorhaug) wants to merge 9 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a strict, “fail-closed” release-decision model based on a canonical, action-owned release: label set, removing legacy/bare label influence and eliminating default/automatic patching behavior.
Changes:
- Adds a PowerShell helper module to define canonical release labels and to resolve/validate release decisions from PR labels.
- Updates the main action logic to (a) provision canonical labels each run and (b) drive release/prerelease/skip decisions exclusively via the resolver.
- Updates documentation, action inputs, and workflows to reflect the new owned-label contract and required events/permissions; adds unit tests for the resolver.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tests/Release-GHRepository.Helpers.Tests.ps1 |
Adds Pester coverage for canonical label definitions and release-decision resolution/rejection rules. |
src/Release-GHRepository.Helpers.psm1 |
Introduces canonical label definitions and the strict Resolve-ReleaseDecision validator. |
src/main.ps1 |
Provisions canonical labels and replaces legacy label/auto-patching logic with the resolver output. |
README.md |
Documents the owned-label contract, workflow requirements, and v2→v3 migration steps. |
action.yml |
Removes legacy label/auto-patching inputs and clarifies Prerelease input semantics. |
.github/workflows/Release.yml |
Ensures label transitions are evaluated (unlabeled) and grants issues: write for label provisioning. |
.github/workflows/Action-Test.yml |
Adds Pester unit tests and expands PR event types to include unlabeled. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
src/main.ps1:154
$createPrereleasecan become true for merged/closed pull requests when the PR targets a non-default branch (because$closedPullRequestonly covers closed-but-not-merged). That would create prereleases from closed PRs, conflicting with the intended “open pull request prerelease” behavior.
$createPrerelease = $releaseDecision.Prerelease -and -not $createRelease -and -not $closedPullRequest
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
.github/workflows/Release.yml:19
pull_request_targetsetsgithub.refto the base/default branch (e.g.refs/heads/main), so using${{ github.workflow }}-${{ github.ref }}collapses all PR runs into the same concurrency group. Withcancel-in-progress: true, activity on one PR can cancel an in-progress run for a different PR, which can interrupt release/prerelease creation or cleanup. Use a PR-scoped key (e.g. PR number) to isolate runs per PR (matching the README guidance).
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
Release decisions now use an owned
release:label set, preventing dependency metadata and legacy bare labels from choosing a repository version.Breaking Changes
Release-GHRepository@v3removesAutoPatching,IgnoreLabels,MajorLabels,MinorLabels, andPatchLabels. Consumers must grantissues: write, subscribe tounlabeled, remove release-workflow path filters, and replace legacy decisions before moving from v2.Existing v2 tags remain unchanged. The v3 tags are created only after this pull request is reviewed and merged.
New: Canonical release labels
release:patchrelease:minorrelease:majorrelease:pre-releaserelease:skipThe action provisions and reconciles these labels while leaving all unrelated labels unchanged. Dry runs report the label changes without mutating repository state.
Changed: Release decisions fail closed
Exactly one bump label or
release:skipis required. Missing decisions, multiple bumps,release:skipcombined with another owned label, andrelease:pre-releasewithout one bump stop the action. Bare and legacy labels are ignored as release inputs.Prereleases are restricted to open pull requests. Stable releases and closed-pull-request cleanup preserve the existing v2 release lifecycle.
Technical details
src/Release-GHRepository.Helpers.psm1.pull_request_targetwithout checking out an untrusted head; concurrency remains cancel-in-progress but is scoped per pull request.Prereleaseremains an action input only for selecting a prerelease GitHub module dependency; it does not control repository release behavior.src/**,tests/**action.yml,.github/workflows/**README.mdRelevant issues (or links)
Related work