Repository navigation
Release decisions use owned labels and effective settings - #109
Marius Storhaug (MariusStorhaug) wants to merge 37 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 verification is needed because the change affects a privileged pull_request_target publisher and breaking consumer contract, while live permissions, publication, immutable adoption, compatibility, and required pre-merge enforcement remain unverified.
No open issues 🎉
Review effort: Lite
There was a problem hiding this comment.
🔵 Needs a closer look
The change combines privileged pull_request_target publication with a breaking public contract, while live permission safety, release behavior, and immutable consumer adoption remain unverified and require human validation.
No open issues 🎉
1 resolved since last review
Review effort: Lite
There was a problem hiding this comment.
🔵 Needs a closer look
The privileged pull_request_target release changes require authorized human validation of live permissions, fork-source behavior, immutable adoption, and production tag/release publication.
No open issues 🎉
Review effort: Lite
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
|
|
||
| on: | ||
| pull_request: | ||
| pull_request_target: # zizmor: ignore[dangerous-triggers] trusted base checkout; writes labels and releases |
There was a problem hiding this comment.
This publication-source gap remains open. The configuration correction leaves Release.yml unchanged from its starting head 714b801; it does not change publication authority or checkout selection. That work remains outside this assignment under #108, with #112 still a native blocker.
I will record this thread as an unresolved publication-readiness limit. PR 109 stays draft with auto-merge off. The read-only caller results do not establish safe production checkout or tag publication.
| LogGroup 'Provision release labels' { | ||
| if ([string]::IsNullOrWhiteSpace($env:GITHUB_REPOSITORY)) { | ||
| throw 'GITHUB_REPOSITORY is required to provision release labels.' | ||
| } | ||
|
|
||
| foreach ($definition in Get-ReleaseLabelDefinition) { |
There was a problem hiding this comment.
This unsupported-event mutation remains an unresolved finding. Label provisioning already precedes the non-PR guard at the starting head 714b801; this scoped correction changes configuration startup and cleanup, not release-event mutation authority.
I have not moved that guard or changed the provisioner. The PR record will state the remaining limit. Local controller cases and the hosted caller use controlled boundaries or explicit WhatIf: true; they do not prove that live non-PR invocations are mutation-free. PR 109 stays draft with auto-merge off.


Repository and workflow maintainers must replace legacy release controls and use
SettingsFilePathbefore they adopt this release. The action uses five owned labels and a configurableDefaultBump. The settings file and matching named inputs also control startup before GitHub-Script selects its dependency or execution directory.Validate the caller with
WhatIf: truebefore authorized adoption. This draft is not a production reference. This lower delivery keeps.github\auto-release.yml; the separate filename delivery owns.github\release.settings.yml.Breaking: Owned release decisions replace legacy controls
Only
release:patch,release:minor,release:major,release:prerelease, andrelease:skipcontrol releases. One owned bump overrides the valid effectiveDefaultBump. Without an owned bump or skip, that setting selects exactlypatch,minor, ormajor; its standard ispatch.release:prereleaseselects prerelease mode for an open pull request. It uses the explicit or configured bump.release:skipvalidates without version resolution or publication; a closed skipped pull request still receives configured prerelease cleanup. Multiple bumps, or skip with another owned label, fail. Bare, dependency, unknown, noncanonical, and retiredrelease:pre-releaselabels do not select a bump.Before adoption:
major,breaking, orNoReleaseas compatibility signals. Do not relabel historical pull requests or delete unrelated labels.AutoPatching,IgnoreLabels,MajorLabels,MinorLabels, andPatchLabelsfrom inputs and settings. Replace automatic patch policy with the intendedDefaultBump, or omit it for the patch standard. WhereAutoPatching: falsesuppressed publication, userelease:skipon the active pull request. No disabled or date-based automatic bump is added.with: ConfigurationFilekey towith: SettingsFilePathand preserve its value. There is no alias. Keep.github\auto-release.yml, or the same deliberate custom path, when adopting only this lower delivery. Do not apply the new input name to an older reader.inheritmarkers and flatten a formerCallerOverridesmapping into named inputs. Omit an input or leave it empty instead. Remove any earlier requirement to copy a bundled defaults asset. No replacement asset, omission token, clear flag, or mapping input is added.issues: writefor label provisioning, in addition to release and comment permissions. Evaluateopened,reopened,synchronize,labeled,unlabeled, andclosedwithout a workflow path filter that bypasses the decision. A privilegedpull_request_targetwriter must execute trusted base code, never an untrusted pull-request head. Validate candidate code in a separate read-only workflow.WhatIf: true. Verify file inheritance, explicit overrides, empty text, owned-label conflicts, and invalid settings. KeepUsePRBodyAsReleaseNotesandUsePRTitleAsNotesHeadingtrue when the complete authored release record is required; their existing opt-outs remain supported.Module settings such as
PSModule.ymlandSettingsPathdo not change. The later filename delivery requires its own coordinated file and caller change with a compatible reader. This PR does not change consumer templates, live permissions, rulesets, releases, or tags.Technical details
Publication coverage. The product is a Git-distributed GitHub Action on the stable GitHub-release/version-tag channel. The current 56-record publication inventory identifies v2.0.3, receipt
351975133, published2026-07-10T08:29:31Z, as the latest successful stable release. Its retained tag points to source750abed0ecab02394554b610dc3aa191e75e3248.Candidate source is
PSModule/Release-GHRepository@1040867819d77ef79c88d4492e10e8a8a7b6a37b, tree71b3ccb5bbb9e7daa70fc559c0789a6ee405a662. The complete published-source-to-candidate comparison is750abed0ecab02394554b610dc3aa191e75e3248..1040867819d77ef79c88d4492e10e8a8a7b6a37b. The separately retained PR-base comparison currently starts at the same source. Its nine-file range includes the earlier owned-label, settings, prerelease, workflow, and caller changes; it excludes the upper filename feature.The published reader matches its legacy label lists, not the owned names. The main-targeting candidate therefore requires verified publisher bootstrap and the native decision gate before finalization. A label alone does not establish that the current base writer can publish the intended major release.
action.ymlinput migration and READMEThe canonical standards source inspected is
MSXOrg/docs@d5bc395416fb4194c1801871990f46faf301bf8a. Reader-facing prose uses en-US and ASD-STE100 Issue 9 writing practices. Lint results do not certify full STE conformance.Delivery boundaries. #111 owns this resolver delivery and remains natively blocked by #112. The convergence sweep examined open release-settings issues 111, 115, 112, and 108. Only 111 converges; filename migration, enforcement, publication authority, and compatible immutable template/completion evidence remain separate. No other issue closes through this change.
Both new source commits are ordinary additive commits:
7ab87bc07d58a513716e50c947d76852fc6065e9and1040867819d77ef79c88d4492e10e8a8a7b6a37b. Earlier split commits remain in history. No amend, force-push, merge, publication, or upper-worktree change was used.Related references
New: File settings and named inputs control startup through one contract
All 16 meaningful settings can be configured in the selected file or through their matching named inputs. The five startup controls are
Debug,Verbose,WorkingDirectory,Version, andPrerelease. The 11 release-policy settings remain configurable, includingVersionPrefixwith standardv.Versionselects the GitHub module dependency by exact version or NuGet version range.Prereleasepermits prerelease versions of that dependency; it does not select repository prerelease mode. Userelease:prereleasefor that mode. Existing explicit startup inputs retain their meanings; omit them when the file must supply the value.Settings use this order: private schema standards, selected repository file, then known nonempty named inputs. Explicit false remains an override. Null and empty inputs retain file values. Validate every supplied layer, including invalid values that a later override could mask.
SettingsFilePathis the external selector, not a key in its selected file.File selection precedes execution:
WorkingDirectoryfromgithub.workspace. Without that input, usegithub.workspaceas the initial directory.SettingsFilePathfrom that initial directory. Keep absolute selectors literal, including spaces and brackets.WorkingDirectoryvalues fromgithub.workspace.WorkingDirectoryremains the final override.A missing selected file uses valid standards and named inputs. Empty selectors, directory selectors, non-file-system providers, unknown keys, null file values, invalid types, invalid dependency constraints, and nonexistent execution directories fail before GitHub-Script starts. Supported empty
VersionPrefix,DatePrereleaseFormat, andVersiontext belongs in the file. EmptyVersionselects the latest dependency.One private metadata declaration defines types and standards. File-configurable named inputs have no concrete native defaults; their descriptions display effective standards. The selector retains its separate
.github\auto-release.ymldefault. No bundled defaults file, presence heuristic, public mapping input, parallel vocabulary, or constant prefix is added.Technical details
src\Initialize-ReleaseConfiguration.ps1resolves settings before the pinned GitHub-Script action starts. It forwards the five resolved startup outputs to that action and passesReleaseSettingsJSON through a private handoff tomain.ps1. The controller does not read the file or merge raw inputs after dependency selection, debugging, or directory selection.Current validation. Pester 6.1.0 passes all 223 repository cases locally, with zero failures, skips, or not-run cases. A final-source focused run passes 53 selected cases; 170 cases are outside that filter. PSScriptAnalyzer 1.25.0 examines five PowerShell files with zero diagnostics. README Markdown lint, actionlint 1.7.12, and offline zizmor pass. The exact-head native lint job and all 13 lint contexts pass.
The test-first control runs 28 new failing cases against the starting implementation. Eight reject the unsupported startup fields, 18 require the new bootstrap entry point, and two reproduce the cleanup counterexamples with PSSemVer 1.1.10. Current tests exercise the real bootstrap, resolver, YAML parser, output-command handoff, and controller. They verify all five startup fields, defaults/file/input precedence, omitted and empty inputs, false and standard-valued overrides, invalid masked layers, literal paths, and frozen policy after the file or raw inputs change.
The exact-head native Pester job executes 223 cases, with zero failures, skipped cases, or not-run cases. The actual read-only caller job uses the same existing runner-temp file for both invocations. Each has five observed GitHub-Script startup fields and seven observed controller-policy fields:
true; Version[0.43.1]; execution.githubmajor/RepositorySetting; AutoCleanup and CreateMajorTagfalse; fileyyyyMMddandvretainedfalse; Version[0.43.1]; executiongithub.workspacepatch/ActionInput; the same false and retained text valuesPreparation, both real composite invocations, and always-run fixture cleanup succeed. Policy and provenance, not the final version, establish precedence. The PR's owned major label still overrides valid policy afterward.
Local controller cases simulate GitHub responses and guard mutation commands. They do not prove real API, authentication, or production permission behavior. The hosted caller uses read-only permissions and explicit
WhatIf: true; it does not prove live publication.action.yml, bootstrap, and private schemaTask 111's updated scope and acceptance plan were saved before implementation. The bounded source, local validation, actual caller, and exact-head CI steps are complete.
The explicitly requested current-head review is
COMMENTED, effort Lite, with three new findings. The path claim was disproved and resolved with the actual Ubuntu default-file read and policy result. The merged-event checkout source and non-PR label mutation findings remain open. They concern publication/event authority that this scoped correction does not change.This review is not approval. Prior-head or upper-layer approvals are not lower-source evidence. Human validation, compatible immutable integration evidence, the two open authority threads, and native blocker 112 remain readiness limits.
Related references
Fixed: Prerelease cleanup uses the effective prefix and exact branch
Cleanup uses the effective
VersionPrefixto locate the actual version core. Version-like or branch-like text inside the prefix cannot select another branch's release. Empty and hyphenated prefixes remain valid; the prefix is not fixed tov.With prefix
release-1.2.3-, cleanup forfeatureselectsrelease-1.2.3-2.0.4-feature.1. With prefixrelease-1.2.3-feature.extra-, it does not selectrelease-1.2.3-feature.extra-2.0.4-other.1. Stable releases, longer identifiers, case mismatches, and later embedded identifiers remain excluded.Automatic cleanup retains releases under other historical prefixes rather than guessing their version boundary. Close active prerelease series before a prefix change, or retain those releases for separate authorized cleanup. Do not assume this action will delete earlier-prefix tags.
Open-PR prereleases still target the exact validated head SHA. Closed skipped pull requests retain cleanup without parsing an unrelated latest version. Publication authority, prerelease counters, and the release lifecycle do not change in this correction.
Technical details
Focused tests use the real resolver and PSSemVer 1.1.10 to generate the two reported tags before checking cleanup. Controller cases verify the corresponding read-only delete plans. The current suite also retains numeric, case-sensitive, empty-prefix, hyphenated-prefix, invalid-core, skip, and reviewed-head cases.
The publication workflow is unchanged from the starting head
714b801478b5c60565fcfb99ac66b440872f5250. The cumulative PR still queues merged publication by target branch and open-PR prereleases by pull-request number without cancellation. The exact workflow-expression and source-configuration Pester assertions were removed; no helper mirrors workflow text.Live concurrency contention is unexecuted coverage. Local cases, actionlint, and the read-only caller do not prove GitHub scheduler behavior or production publication. The inherited merged-PR label-event authority gap remains #108; required pre-merge enforcement remains #112.
Related references
Release decisions
release:majoroverrides valid effective policy; removed legacy controls, the renamed selector, and changed caller precedence require adoption changes.main, and norelease:prereleaseoverride is applied.release:majorThis is the candidate's conditional compatibility decision, not authority to merge or publish through the current v2 base writer. Verify the trusted post-merge reader, compatible immutable integration evidence, and required decision gate first. PR 109 remains draft, auto-merge remains off, and native blocker #112 remains. Publication resolves the actual version, tag, and immutable source; none is assigned to this draft.