Repository navigation
Release-GHRepository requires a release label or a configured bump - #109
Marius Storhaug (MariusStorhaug) wants to merge 55 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 guidance now defines one owned `release:` label set: `release:patch`, `release:minor`, `release:major`, `release:pre-release`, and `release:skip`. Release automation ignores bare and unrelated labels, so only explicit release decisions affect published versions. ## Changed: One release label contract Release Management, Automation Labels, PR Format, Natural Language examples, and the VS Code Extension Framework now use the same namespaced values. Prereleases use `release:pre-release` with one bump label, while non-releasing changes use `release:skip` alone. ## Changed: Ad hoc releases are optional A labeled pull request merge is the required release path. Implementations may add `workflow_dispatch` only when they need an explicit ad hoc mechanism; it must use the same release controls and require its decision and release-note context as inputs. Empty pull requests and direct pushes are not release workarounds. --- <details> <summary>Technical details</summary> - Replaced `release:none` and the unnamespaced `Prerelease` label. - Defined valid and invalid combinations for the five owned release labels. - Made `workflow_dispatch` an optional implementation extension rather than a mandatory release interface. - Preserved the mainline removal of dependency-tool label guidance while resolving the branch update. | Changed surface | Standards checked | Framework docs checked | Result | | --- | --- | --- | --- | | `src/docs/Capabilities/release-management/**` | Natural Language, Markdown | Release Management | Aligned | | Release-label references under `src/docs/**` | Natural Language, Markdown | Automation Labels, PR Format, VS Code Extension Framework | Aligned | </details> <details> <summary>Relevant issues (or links)</summary> ### Related work - References PSModule/Release-GHRepository#109 - References PSModule/Process-PSModule#524 </details> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The stable publication path cannot complete or safely recover because checkout credentials are disabled for required Git tag pushes, and a failed alias update can leave the release permanently inconsistent.
4 open issues
Review effort: Lite
The Release Management design now explains how maintainers can prerelease a reviewed fork contribution. The fork pull request stays read-only and cannot authorize publication. This documentation change requires no changes to existing release workflows or permissions. <!-- ANNOUNCEMENT STOP --> ## New: Prerelease steps for fork contributions An authorized maintainer reviews and approves the exact fork change before merging it into a separate branch in the base repository. Trusted publisher code uses the reviewed revision on that branch. If the route supports prereleases from pull requests, the maintainer applies `release:prerelease` to a same-repository pull request from the branch. The branch alone does not enable publication on push. <details> <summary>Technical details</summary> | Changed surface | Standards checked | Framework docs checked | Result | | --- | --- | --- | --- | | `src/docs/Capabilities/release-management/design.md` | Documentation Model, Markdown, GitHub Actions trust rule | Release Management spec and design | Aligned | - The new **Prerelease a fork contribution** section links to the rule against running untrusted code with a writable token. - Local and cross-repository link checks passed. All 66 Pester tests passed. The Zensical build produced the new section anchor. - The docs workflow deploys to GitHub Pages. It does not publish a versioned artifact. - No delivery issue is linked. The search for fork-related MSXOrg/docs issues found none that this change resolves. </details> <details> <summary>Related links</summary> - References PSModule/Release-GHRepository#109. </details>
There was a problem hiding this comment.
🔵 Needs a closer look
Human validation is still required for the write-enabled GitHub release workflow, immutable consumer compatibility, authenticated publication behavior, and recovery from concurrent or partial failures.
No open issues 🎉
4 resolved since last review
Review effort: Lite
There was a problem hiding this comment.
🔵 Needs a closer look
Human assessment is needed because the changes introduce unverified workflow complexity, including a potentially unavailable test dependency and a concurrency-key mismatch that could allow validation and publication runs to overlap.
No open issues 🎉
Review effort: Lite
There was a problem hiding this comment.
🟡 Changes recommended
Critical active findings show that both the release workflow and its README example lack the required issues: write permission for label creation, causing publishing to fail before release creation.
2 open issues
Review effort: Lite
If your workflow relies on automatic patch bumps, set `DefaultBump: patch`. Without a configured bump, a pull request needs one release bump label or `release:skip`. <!-- ANNOUNCEMENT STOP --> ## Breaking: A missing release decision fails the run The shared `DefaultBump` is `none`. A bump label still overrides a configured bump. `release:prerelease` selects the mode; it does not supply a bump. A valid `release:skip` decision does not need a bump. <details> <summary>Migration guide</summary> 1. If your workflow uses the implicit `patch` behavior from the namespaced label candidate, add `DefaultBump: patch` to the release settings file or action inputs in the upgrade PR. Otherwise, apply one bump label or `release:skip` to each pull request. You do not need to set `none`. 2. If a workflow must require an explicit decision even when the file sets a bump, use `DefaultBump: none` in that invocation. 3. Run the action with `WhatIf: true`. Check that one bump label, a configured bump, and a valid skip each work. Check that `release:prerelease` alone fails when no default is configured. Do not use this draft branch as a production action pin. </details> <details> <summary>Technical details</summary> The scoped base is the fixed resolver revision `fa4b27e2c4a12aeffb66ac01e43d443e7ca6edda` from #109. The revised tests failed before the change. All 237 Pester cases passed with the change. The tests simulate publishing operations. No production rollout or template compatibility is claimed. The linked Release Management design still lists `patch`; align it before publication. </details> <details> <summary>Related links</summary> - Depends on #109 - References #112 </details>
There was a problem hiding this comment.
🟡 Changes recommended
Active issues remain, including a critical path that prevents stable releases from being published on merged pull requests, along with mutable runners, an incorrect default bump, and non-resumable label provisioning.
6 open issues
Allow merged PR closes to publish stable releases · New Pin the release-decision job to a specific runner image · New Pin the publisher job to ubuntu-24.04 · New Restore patch as the shared default release bump · New Provision labels before publication or make setup resumable · New Pin the unit-test job to an approved runner image · New
2 resolved since last review
Review effort: Lite
There was a problem hiding this comment.
🔵 Needs a closer look
Human assessment is needed because the omitted review evidence indicates critical defects in both zero-baseline version calculation and atomic maintenance of stable release aliases.
1 open issue
5 resolved since last review
Review effort: Lite
There was a problem hiding this comment.
🟡 Changes recommended
Two critical active issues remain: first-release version planning fails without a stable baseline, and decision validation can accept stale pull-request title or body content.
2 open issues
3 resolved since last review
Review effort: Lite
There was a problem hiding this comment.
🔵 Needs a closer look
Human assessment is needed because critical hidden findings affect release-version baselining and allow publishing without the required CI gate, making the change too complex to approve confidently.
No open issues 🎉
2 resolved since last review
Review effort: Lite
There was a problem hiding this comment.
🔵 Needs a closer look
Human assessment is needed because two critical hidden findings affect release safety: the workflow may allow publication without the required CI gate, and historical tags with separator-containing prefixes may be ignored, causing incorrect version calculations.
No open issues 🎉
Review effort: Lite



Replace legacy labels with namespaced
release:labels. Update the action pin and the label rules in the same upgrade. If you use automatic patch bumps or moving aliases, configure them explicitly.Run Calculate and CI on
pull_requestupdates. Publish the exact default-branch commit after CI. Choose one action invocation or pass the release plan from an earlier Calculate step in the same run.Breaking: Release decisions need a bump or skip
The action reads only the five labels in the table below. One bump label overrides
DefaultBump. With no bump or skip label, the action uses the configured default. Without a configured bump, the effective value isnoneand the decision fails. Multiple bump labels fail the run.release:skipwith another supported release label also fails.Migration guide
DefaultBump: patchin the workflow or settings file to keep automatic patch bumps. For a different default, useminorormajor. Otherwise, use one bump label orrelease:skipon each pull request. To clear a file default for one caller, set the input tonone.PSModule/Release-GHRepository@<published-release-sha>inuses:. ReplacePSModule/Auto-Releaseif your workflow uses that name. Do not use this pull request's head as a production pin. If you use a template, first verify an immutable template revision with the selected action revision.Mode: calculateon a test pull request. Check that the bump label overrides the default, a valid skip returns no version, and conflicting labels fail. WithDefaultBump: none, check that an unlabeled pull request fails.patchorfixrelease:patchminororfeaturerelease:minormajororbreakingrelease:majorprereleaserelease:prereleasewith one bump label or a configured default on an open pull requestNoReleaseor a custom ignore labelrelease:skipwithout another supported release labelTechnical details
Release coverage for all consumer sections. The product is the Git-distributed action. The publishing target is the GitHub stable release and tag channel. The last confirmed stable publication is v2.0.3, receipt
351975133, published2026-07-10T08:29:31Z. Its notes name #106. The tag and downloaded source archive identify that pull request's squash commit,PSModule/Release-GHRepository@750abed0ecab02394554b610dc3aa191e75e3248. The release is not immutable. The original publisher log is unavailable.Candidate and comparisons. The candidate is
PSModule/Release-GHRepository@3f22cf227aee5709f430eeb79885a2121807a629. The stable source comparison includes the unpublishedpull_requestexample from #114. The separate PR-base comparison starts at0fbca9f0c422d1d8f79e97b3b9fe1d50e106feab.Template compatibility. The Template-Action publisher at
PSModule/Template-Action@634ca503a47a39ca26d72fa59c784da8118ae835still pinsPSModule/Auto-Releasev2.0.2. No compatible template revision has been verified against this candidate.Breaking: Stable releases use pushes to the default branch
A pull request close no longer publishes a stable release. The publisher uses the exact pushed commit and the decision of the pull request that merged at that commit. A direct push without a matching merged pull request does not publish, even with a configured bump. A closed pull request can still clean up prereleases.
Migration guide
pushtrigger for your default branch, for examplemain. Add your CI job toneeds. Limit the publisher togithub.event_name == 'push' && github.ref_name == github.event.repository.default_branch.${{ github.sha }}. Give the stable jobcontents: writeandpull-requests: read. Run the published action in Publish mode. It calculates and publishes in one step unless you supply the plan described below.queue: maxon the publish job. Keep Calculate and CI outside the queue.pull_requestfor prereleases and cleanup, as shown in the updated workflow example. Use trusted code from the base repository. Run the write-enabled job only for same-repository pull requests. Handleopened,reopened,synchronize,labeled, andunlabeledfor open pull requests. Publish an open pull request only withrelease:prereleaseand a valid bump. Handleclosedfor cleanup. Usecontents: writeandpull-requests: writefor that job.release:prereleasewith a bump label or configured default. Review the revision again if it changes.WhatIf: trueon a push that has an exact matching merged pull request. Check that the planned tag points to the pushed SHA. KeepUsePRTitleAsNotesHeadingandUsePRBodyAsReleaseNotesset totrueto use the full pull request title and description. Check that a direct push does not publish and a pull request close only plans cleanup.Related links
Breaking: Named inputs override repository settings
The action resolves the defaults, the selected settings file, and then nonempty named inputs. An explicit
falseor a value equal to a default overrides the file. An omitted, null, or empty named input retains the file value. Invalid values fail even if another layer overrides them.Migration guide
with:setsConfigurationFileto a custom path, rename it toSettingsFilePath. Keep the same path. If it selects.github\auto-release.yml, omit the input. That file remains the default.AutoPatching,IgnoreLabels,MajorLabels, andPatchLabelsfrom the workflow and settings file. If releases were opt-in, userelease:skipon pull requests that must not publish. Follow the new label rules for the other pull requests.WhatIf: falseif the file setsWhatIf: true. Correct unknown keys, null file values, and invalid settings. To remove a version prefix or date suffix, setVersionPrefix: ''orDatePrereleaseFormat: ''in the file.SettingsFilePath, use a path from the explicitWorkingDirectoryinput or, if omitted, fromgithub.workspace. A file-definedWorkingDirectorychanges where the action runs. It does not select a different file. Relative execution directories start atgithub.workspace.Debug,Verbose,WorkingDirectory,Version, orPrereleasein the file.VersionandPrereleaseselect the GitHub PowerShell module. Userelease:prereleaseto select repository prerelease mode.DefaultBump: majorin the file gives a major decision unless an input or label overrides it.Technical details
The settings, startup, and cleanup implementation for #111 is complete in this candidate. The issue review covered push publication, workflow standards, settings, and cleanup. The candidate does not close the broader push publication or required-check issues.
Related links
Breaking: Prerelease records no longer move or delete exact tags
A prerelease uses the exact pull request head. For pull request 42 from
feature/demo, the tag can bev2.1.0-featuredemo-pr42.1. The counter advances within the version core and pull request series. A configured date suffix follows the counter.AutoCleanupremoves only the release records for the matching pull request series and prefix. It keeps their exact tags.IncrementalPrerelease: falsekeeps one visible release record. It does not reuse an old tag.Migration guide
pr-<number>.VersionPrefix.IncrementalPrerelease: false, use the current release record to find the newest prerelease. Do not rely on a fixed tag for the branch.Breaking: Moving major and minor aliases require opt-in
A stable release still gets an exact version tag. The action does not create or move major or minor aliases by default. After it verifies a stable release, each enabled alias points to the greatest completed version in its family.
Migration guide
vMAJORorvMAJOR.MINOR, setCreateMajorTag: trueorCreateMinorTag: true, respectively. Keep the same settings in Calculate and Publish.New: Calculate a version in CI without publishing
Mode: calculatechecks the decision without changing GitHub. On an open pull request, it can calculate a prerelease version withoutrelease:prerelease. It uses a configured bump when there is no bump or skip label. Without either a decision or a default, the step fails and tells you how to select a bump or skip. A valid skip returns no version.Use the action once to calculate and publish after CI. To use the version earlier in the workflow, calculate it first and pass
ReleasePlanunchanged to Publish. Publish rejects a changed plan before it writes a different release.Migration guide
contents: readandpull-requests: read. Add a step withid: calculateandMode: calculate. For pull request checks, usepull_requestwithopened,reopened,synchronize,labeled,unlabeled, andedited.steps.calculate.outputs.Decision,BumpSource, andReleaseVersion. Expectreleaseand an unprefixed version for a valid bump. Expectskipand an empty version and plan for a valid skip. For a push to a branch with an open pull request, setPullRequest: OWNER/REPO#NUMBERif more than one matches or the push is in a fork.Planjob on pushes to the default branch. Use the same action revision and release settings in Plan and Publish. ExposeDecision,ReleaseVersion, andReleasePlanas outputs. UseReleaseVersionfor build steps that need the version. Do not carry the pull request preview into the push run.needs: [Plan, CI]on the stable publisher. In addition to the push condition, requireneeds.Plan.outputs.Decision == 'release'. Check that${{ needs.Plan.outputs.ReleasePlan }}is nonempty before you call Publish. If it is empty, fail the job. Set the Publish inputReleasePlanto that unchanged output. Do not pass the release version to the dependency inputVersion.WhatIf: trueto verify the handoff within the same push run. Check the planned target and tag. OmitReleasePlanif you choose to calculate and publish in one step instead. If the plan changes before publication, run Calculate and CI again.For the staged path, save this example as
.github/workflows/Repository-Release.yml. Replace both<released-commit-sha>placeholders with the full commit SHA of the same published action release. Set the trigger branch to your default branch. Addworkflow_callunderon:in your existingTest-Actions.yml, or replace theCIjob with your own tests. The CI job must test${{ github.sha }}.Keep this job read-only until you verify the preview. On a pull request with a valid decision, CI runs and Publish is skipped. On a default-branch push with a release decision, Publish runs after CI and previews a tag for the tested commit. A valid
release:skipstill runs CI but skips Publish. To enable writes, removeWhatIf: true, make sure the effectiveWhatIfisfalse, and change only thePublishjob'scontentspermission towrite. Do not run a second stable publisher for the same repository.Technical details
GitHub Actions ran the example above in a private fixture repository. The test substituted this candidate SHA for both action pins and used a reusable CI job that checked the tested SHA. The initial direct push ran CI and skipped Publish. An unlabeled pull request failed Plan because it had no bump or default. After
release:patchwas added, Plan and CI passed and Publish was skipped on the pull request.The squash push run
46291394817passed Plan, CI, and Publish in that order. Publish accepted the unmodified plan from the same run and previewedv0.0.1at the tested SHAbca15b761def930ef9bb7d4e4a058360b7aa90a0. The fixture had no releases or tags after the run. This demonstrates the hosted caller handoff in read-only mode. It does not verify live publication, branch rule enforcement, or Template-Action compatibility.New: Stable releases account for earlier unpublished changes
The publisher checks the first-parent changes after the greatest completed stable release. The bump must cover the highest known increment in that range. If a prior change was skipped or has no known bump, apply an explicit aggregate bump after review.
Migration guide
<!-- release-range: <published-source-sha>...<last-preceding-sha> -->. Use full SHAs. Useinitialin place of the published SHA for a first release.Fixed: Retries keep the exact version and notes
Publish reserves the version with an annotated tag at the exact source. A retry uses the recorded version and full notes. It verifies an existing release rather than publishing a second version for the same stable commit. If publication stops after reservation, resume the original stable request before you publish later changes. Do not delete the stable release record to withdraw it.
Internal: Run the release decision and CI before publication
Plan / Release decisionchecks pull requests tomain, including forks and documentation-only changes. CI runs independently, even if Plan fails or returnsskip. A push tomainrepeats the decision and tests on the exact pushed commit. Stable publication requires both jobs to pass and the decision to berelease.Review only. Do not merge this pull request yet. The PR decision job is advisory. A label-only rerun does not invalidate an earlier pass on the same commit. The trusted check and live rule change remain under #112. Independent approval is still necessary. No stable release or live branch rule change is part of this review.
Technical details
This candidate includes the label and decision work from #118, #119, #120, and #121. All 363 local and hosted Pester cases passed. Tests simulate the publication writes for both paths, including the exact target, full notes, and recovery after tag reservation. Hosted lint, Plan, and the caller compatibility job passed. The private fixture verified the hosted read-only handoff. These results do not verify live stable publication or branch rule enforcement.
noneunless a bump is configured. The spec and design still listpatchas the shared default. Update those docs before publication.Related links
Release details
release:majorselects the bump. Legacy labels and stable publication on pull request close are incompatible.mainafter Plan and CI succeed.release:major