Repository navigation
Release-GHRepository uses dedicated pull request labels - #109
Marius Storhaug (MariusStorhaug) wants to merge 41 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.
🔵 Needs a closer look
Human validation is required because the change modifies privileged pull_request_target permissions, label provisioning, and release/tag publication behavior that cannot be verified safely from static review alone.
No open issues 🎉
Review effort: Lite
There was a problem hiding this comment.
🔵 Needs a closer look
The privileged release workflow changes permissions, fork-head targeting, labels, releases, tags, and concurrency, but repository-only tests do not verify its live authorization, immutable adoption, or publication behavior.
No open issues 🎉
Review effort: Lite
There was a problem hiding this comment.
🟡 Changes recommended
Three critical active findings remain in the release workflow, path resolution, and event-guard logic, including risks of publishing the wrong revision and mutating labels on unsupported events.
3 open issues
Review effort: Lite
MSX pull request authors now put the exact upgrade steps in a `Migration guide` block for each result that needs one. Keep the impact, reason, affected uses, and required action visible so consumers can see what applies to them. If you skip versions, read the release notes after your actual baseline through the version you select. Keep any intermediate operation that the notes require. This change updates the guidance; it does not change release automation or require product configuration edits. <!-- ANNOUNCEMENT STOP --> ## Changed: Pull request authors keep adoption steps with each result The pull request supplies the release note. The release record must preserve the complete reviewed title and description for the exact source, including collapsed blocks. Authors can keep the visible text short without sending consumers to a diff, template, or separate guide for required steps. Use the new section order and block names when you write or update an MSX pull request. Keep the existing summary marker. If a result needs no adoption steps, explain why no action is necessary and omit the migration block. <details> <summary>Migration guide</summary> 1. Put the most important consumer result in the title and summary. For each result, state what changes, why it matters, and which uses remain compatible. Give the required action or the reason why no action is necessary. Keep deadlines and prerequisites that control the upgrade visible. Put the summary marker on its own line after the summary. 2. Use `## <qualifier>: <result>` for each result. Put consumer sections in this order: `Breaking`, `Removed`, `New`, `Changed`, and `Fixed`. Put `## Internal: <result>` sections after consumer sections. If the change is only internal, use the internal result in the title and summary. 3. If a result has adoption steps, use a `<details>` block with `<summary>Migration guide</summary>`. If a draft uses `Migration details`, replace that block name with `Migration guide`. Give the applicable baselines and exact edits in order. Include any required intermediate operation and the expected result of each check. 4. Put applicable `Technical details` and `Related links` blocks after the migration block. Replace `Related references` with `Related links`. If evidence supports more than one result, record it once and name those results. 5. If the target route invokes Release Management, put `Release details` last. Replace the old `Release decisions` block name. Check the decision against the full release range, effective configuration, and owned labels. If the route does not invoke Release Management, omit the block and all `release:*` labels. </details> <details> <summary>Technical details</summary> The delivery plan is complete in this branch. The review compared the old and new examples, checked first-publication and deferred-release cases, and read through a skipped-version upgrade. In that case, the target superseded a configuration rename but still required the earlier data conversion. The notes provided both decisions without a separate guide. Local checks passed: 66 Pester tests, Markdown lint on 18 changed files, local links in 130 files, four GitHub links in changed files, and a strict site build with Zensical 0.0.50. The build confirmed that the previous PR Format section links still resolve. These results support both consumer sections. The MSX plugin metadata uses version `0.3.1`. The PR authoring and consumer upgrade skills still link to the canonical guidance. The target branch deploys the documentation site to GitHub Pages. It does not invoke Release Management. This pull request changes no workflow and publishes no versioned artifact. | Changed surface | Standards checked | Framework docs checked | Result | | --- | --- | --- | --- | | PR format, readiness, and workflow guidance | PR Format, Documentation Model, Natural Language, Markdown | Release Management: release notes and evidence | Aligned | | Consumer upgrades and release guidance | Consumer Upgrades, Documentation Model, Continuous Delivery and Release | Release Management: artifact scope, source, and template evidence | Aligned | | Repository governance and dependency update guidance | Repository Standard, PR Format | Repository Governance and Dependency Updates | Aligned | | Contributor instructions, skills, and plugin manifests | Contribution Workflow, PR Format | Agentic Development: plugin distribution | Aligned | The issue search covered open titles about upgrades, release notes, and PR format in MSXOrg/docs. This change does not resolve another issue in that set. </details> <details> <summary>Related links</summary> - Resolves #299 - References PSModule/Release-GHRepository#109 </details> ## Changed: Consumers use the full release range to plan skipped-version upgrades Start with the version or source that you actually use, not the current destination of a moving tag. Read each applicable note after that baseline through the fixed target. This gives you required steps that the newest note alone might not contain. If a later note replaces an earlier edit, follow the replacement. Keep any intermediate installation or run that the notes still require. If a required step is missing, stop the affected upgrade and report the gap to the producer.
There was a problem hiding this comment.
🔵 Needs a closer look
Human assessment is needed because the release workflow and documented caller both disable checkout credentials while the action still performs authenticated Git fetch and push operations, creating a complex publication-path failure risk.
No open issues 🎉
3 resolved since last review
Review effort: Lite
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>

Before you upgrade a workflow that publishes releases, replace the legacy release labels. If the workflow sets
ConfigurationFile, useSettingsFilePathinstead. Check the effective settings in a read-only run before you enable writes.The action reads only its five
release:labels. Labels for other automation no longer change the bump, start a prerelease, or skip a release. Stable tags point to the commit that the pull request adds to the default branch.Breaking: Legacy release controls no longer apply
Use the five labels in the migration guide to select a bump, a prerelease, or a skip. A pull request run with
WhatIf: falsecreates missing release labels and corrects their colors and descriptions. It leaves other labels unchanged. A run without a pull request does not change labels or publish a release.If a pull request has no bump or skip label, the action uses
DefaultBump. The default ispatch. The action rejects conflicts instead of selecting one of the instructions.Keep your settings file. Rename any explicit
ConfigurationFileinput toSettingsFilePath. Nonempty inputs now override values from the file, even when the input equals the shared default. If you want the file to control a setting, remove the matching input.Migration guide
Applicable releases. You can upgrade from v2.0.3 without an intermediate installation. If you use an older release or a moving reference, find the revision that actually ran. Read each applicable release note after that baseline through your target, in release order. Use those notes to make your upgrade plan. Install or run an intermediate version only if the notes say it is necessary.
ConfigurationFile: .github/custom-release.ymltoSettingsFilePath: .github/custom-release.yml. Use your existing path. If you use.github/auto-release.yml, keep the file and omit the selector. An empty selector is invalid. This release does not move the file to.github/release.settings.yml.AutoPatching,IgnoreLabels,MajorLabels,MinorLabels, andPatchLabelsfromwith:and the settings file. OmitDefaultBumpfor automatic patch releases, or set it to exactlypatch,minor, ormajor. IfAutoPatching: falseprevented publication, userelease:skipon each pull request that must not publish. An omitted or empty input keeps the file value. For example, removeWhatIf: falsefromwith:if the file'sWhatIf: truemust apply. To clearVersionPrefixorDatePrereleaseFormat, set it to''in the file. Remove unknown keys and correct invalid or null values, even if an input overrides them.opened,reopened,synchronize,labeled,unlabeled, andclosedevents. Remove any path filter that prevents the workflow from checking a release decision. The job that publishes needscontents: writefor releases,issues: writefor label setup, andpull-requests: writefor comments. If apull_request_targetjob has write access, use trusted code rather than code from the pull request head. If your route publishes the PR as the release note, keepUsePRBodyAsReleaseNotesandUsePRTitleAsNotesHeadingenabled.WhatIf: true. Check the selected file and the source of the bump. WithDefaultBump: majorin the file, expectmajorif you omit the input. If you passDefaultBump: patch, expectpatch. With either setting, expectrelease:minorto selectminor. Check thatrelease:skipplans no release and that the action rejects conflicting labels.patchorfixrelease:patchminororfeaturerelease:minormajororbreakingrelease:majorrelease:patch,release:minor, orrelease:major.prereleaserelease:prereleaseon an open pull request. Use it alone for the default bump or with one bump label.NoReleaseor a custom ignore labelrelease:skip. Do not combine it with another owned label.Technical details
Release coverage for all consumer results. The product is the Git-distributed Action. The target is GitHub's stable release and tag channel. The last successful release is v2.0.3, receipt
351975133, from2026-07-10T08:29:31Z. The tag points toPSModule/Release-GHRepository@750abed0ecab02394554b610dc3aa191e75e3248. The candidate isPSModule/Release-GHRepository@290d1122fe366d41856043739b029e8361e7593d. The source comparison covers all consumer results. The separate PR-base comparison has the same endpoints becausemainis at the published source.Candidate evidence. The local Pester suite passed 232 cases for release decisions, startup settings, and stable and prerelease behavior. This does not verify production publication or compatibility with an immutable consumer template.
New: Workflows can share startup settings
Set the GitHub PowerShell module version, execution directory, and diagnostics in the same file as your release policy. This lets workflows use the same defaults. Existing startup inputs still work. No additional edit is necessary if you want each caller to set its own values.
Migration guide
Debug,Verbose,WorkingDirectory,Version, orPrereleasein the file. For example, moveDebug: truefromwith:to the file. Keep the named input only if that caller must override the file.Versionaccepts an exact module version or a NuGet range. To use the latest module version, setVersion: ''in the file.Prereleasepermits prerelease versions of that module. Userelease:prereleasefor a repository prerelease.SettingsFilePathstarts from theWorkingDirectoryinput. If you omit that input, it starts fromgithub.workspace. A relativeWorkingDirectoryin the file starts fromgithub.workspace. It does not select a different settings file. If the file is absent, the action uses valid defaults and inputs. An invalid path, directory, or setting stops the run before GitHub-Script starts.WhatIf: true. Check the settings log for the selected file, execution directory, and startup values.Fixed: Stable tags use the merged commit
The stable version tag and the enabled major and minor tags point to the commit that the pull request adds to the default branch. For a squash merge, this is the squash commit. A later merge does not change the tag target. If the version tag points to a different commit, the action stops and does not move it. No additional workflow change is necessary for this fix.
Technical details
The action uses
pull_request.merge_commit_shaonly for a closed, merged pull request that targets the default branch and does not selectrelease:skip. It fetches that commit before repository writes and creates the exact version tag without force. It updates only the enabled aliases after GitHub creates the release.An isolated Git remote had a pull request head, a squash commit, and a later
maintip. The action setv3.0.0,v3, andv3.0to the squash commit. Whenv3.0.0already pointed to a different commit, the action did not publish or move any of those tags.Fixed: Prereleases use the exact head commit
The prerelease tag now points to the pull request's head commit, not to a branch that can move. With
AutoCleanupenabled, closing a pull request removes only prereleases in its exact case-sensitive series under the effectiveVersionPrefix. Stable releases and other series stay in place.release:skipstops publication but does not stop cleanup.You do not need to edit your workflow for these fixes. If you also change
VersionPrefix, close active prerelease series under the old prefix first or arrange separate cleanup. The action keeps releases under earlier prefixes.Internal: The repository writer checks out the merged source
On a merge, the repository's release workflow checks out the exact merged commit. For other events, it uses the trusted base commit. This keeps the workflow from using a newer source or code that did not merge. It also checks label removals without a path filter.
Technical details
Scope. This change delivers #111. It does not add publication from push events or configured prerelease branches. Durable release intent and recovery are outside this change.
Draft blockers. The writer on
maindoes not read the new labels. Verify that the writer for this merge appliesrelease:majorto the exact squash commit. Enforce the required release decision check onmainand verify applicable immutable consumer template compatibility. The candidate addresses the source selection and label changes outside pull requests findings. Both threads remain open for review.Related links
Release details
release:majoroverrides the sharedpatchdefault. The base publisher does not read this label.main. There is no prerelease override.release:majorThis is the intended decision. It does not authorize publication. Keep this PR in draft until the publication and review blockers are resolved.