Skip to content

Release-GHRepository uses dedicated pull request labels - #109

Open
Marius Storhaug (MariusStorhaug) wants to merge 41 commits into
mainfrom
namespaced-release-labels
Open

Marius Storhaug (MariusStorhaug) wants to merge 41 commits into
mainfrom
namespaced-release-labels

Conversation

@MariusStorhaug

@MariusStorhaug Marius Storhaug (MariusStorhaug) commented Aug 28, 2026 •

Copy link
Copy Markdown
Member

Before you upgrade a workflow that publishes releases, replace the legacy release labels. If the workflow sets ConfigurationFile, use SettingsFilePath instead. 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: false creates 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 is patch. The action rejects conflicts instead of selecting one of the instructions.

Keep your settings file. Rename any explicit ConfigurationFile input to SettingsFilePath. 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.

  1. Prepare your caller. Pin the full commit SHA of a published release that supports these labels and inputs. For a custom path, change ConfigurationFile: .github/custom-release.yml to SettingsFilePath: .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.
  2. Keep your release policy. Remove AutoPatching, IgnoreLabels, MajorLabels, MinorLabels, and PatchLabels from with: and the settings file. Omit DefaultBump for automatic patch releases, or set it to exactly patch, minor, or major. If AutoPatching: false prevented publication, use release:skip on each pull request that must not publish. An omitted or empty input keeps the file value. For example, remove WhatIf: false from with: if the file's WhatIf: true must apply. To clear VersionPrefix or DatePrereleaseFormat, set it to '' in the file. Remove unknown keys and correct invalid or null values, even if an input overrides them.
  3. Prepare the label and workflow changes. Use the table to map active pull request labels and the rules that set them. Include opened, reopened, synchronize, labeled, unlabeled, and closed events. Remove any path filter that prevents the workflow from checking a release decision. The job that publishes needs contents: write for releases, issues: write for label setup, and pull-requests: write for comments. If a pull_request_target job has write access, use trusted code rather than code from the pull request head. If your route publishes the PR as the release note, keep UsePRBodyAsReleaseNotes and UsePRTitleAsNotesHeading enabled.
  4. Check the change without writes. In a separate read-only job, set WhatIf: true. Check the selected file and the source of the bump. With DefaultBump: major in the file, expect major if you omit the input. If you pass DefaultBump: patch, expect patch. With either setting, expect release:minor to select minor. Check that release:skip plans no release and that the action rejects conflicting labels.
  5. Switch the writer and the active labels together. Do not let a v2 writer act on pull requests that use the new labels. Leave historical pull requests and unrelated labels unchanged.
Legacy instruction Replacement
patch or fix release:patch
minor or feature release:minor
major or breaking release:major
A custom bump label The corresponding release:patch, release:minor, or release:major.
prerelease release:prerelease on an open pull request. Use it alone for the default bump or with one bump label.
NoRelease or a custom ignore label release: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, from 2026-07-10T08:29:31Z. The tag points to PSModule/Release-GHRepository@750abed0ecab02394554b610dc3aa191e75e3248. The candidate is PSModule/Release-GHRepository@290d1122fe366d41856043739b029e8361e7593d. The source comparison covers all consumer results. The separate PR-base comparison has the same endpoints because main is 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.

Changed surface Standards checked Framework docs checked Result
Label resolver, settings order, and action inputs Automation Labels, PowerShell, Error Handling, Testing Owned instructions, caller overrides Aligned
Settings filename Naming Release settings file Exception - #115
Startup settings and caller tests PowerShell, GitHub Actions, Markdown, Testing Pinned GitHub-Script inputs Aligned
Prerelease target and cleanup PowerShell, Testing Prerelease source and series Aligned

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
  1. Set shared values in the file. You can set Debug, Verbose, WorkingDirectory, Version, or Prerelease in the file. For example, move Debug: true from with: to the file. Keep the named input only if that caller must override the file. Version accepts an exact module version or a NuGet range. To use the latest module version, set Version: '' in the file. Prerelease permits prerelease versions of that module. Use release:prerelease for a repository prerelease.
  2. Check relative paths. A relative SettingsFilePath starts from the WorkingDirectory input. If you omit that input, it starts from github.workspace. A relative WorkingDirectory in the file starts from github.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.
  3. Check the result. Run the action with 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_sha only for a closed, merged pull request that targets the default branch and does not select release: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 main tip. The action set v3.0.0, v3, and v3.0 to the squash commit. When v3.0.0 already 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 AutoCleanup enabled, closing a pull request removes only prereleases in its exact case-sensitive series under the effective VersionPrefix. Stable releases and other series stay in place. release:skip stops 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 main does not read the new labels. Verify that the writer for this merge applies release:major to the exact squash commit. Enforce the required release decision check on main and 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.

Changed surface Standards checked Framework docs checked Result
Release and validation workflows GitHub Actions, YAML, least privilege Release authority, required decision check Exception - #108, #112, #105
Related links
Release details
  • Release: Yes - the versioned action changes its supported labels and inputs.
  • Version bump: Major - callers must replace legacy labels and inputs and check which settings apply. In the candidate, release:major overrides the shared patch default. The base publisher does not read this label.
  • Mode: Stable - the target is the default branch main. There is no prerelease override.
  • Labels: release:major

This is the intended decision. It does not authorize publication. Keep this PR in draft until the publication and review blockers are resolved.

Copilot AI 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

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.

Comment thread .github/workflows/Action-Test.yml Resolved
Comment thread .github/workflows/Release.yml Resolved
Comment thread src/main.ps1 Resolved

Copilot AI 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 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

  • $createPrerelease can become true for merged/closed pull requests when the PR targets a non-default branch (because $closedPullRequest only 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

Comment thread .github/workflows/Release.yml Resolved

Copilot AI 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 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_target sets github.ref to the base/default branch (e.g. refs/heads/main), so using ${{ github.workflow }}-${{ github.ref }} collapses all PR runs into the same concurrency group. With cancel-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

Copilot AI 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 7 out of 7 changed files in this pull request and generated no new comments.

Marius Storhaug (MariusStorhaug) added a commit to MSXOrg/docs that referenced this pull request Aug 29, 2026
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>
@MariusStorhaug
Marius Storhaug (MariusStorhaug) marked this pull request as ready for review August 29, 2026 11:31
@MariusStorhaug
Marius Storhaug (MariusStorhaug) enabled stacked auto-merge (squash) August 29, 2026 11:31

Copilot AI 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.

🔵 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

Copilot AI 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.

🔵 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

Copilot AI 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.

🟡 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

Comment thread .github/workflows/Release.yml Resolved
Comment thread action.yml Resolved
Comment thread src/main.ps1 Resolved
@MariusStorhaug Marius Storhaug (MariusStorhaug) changed the title Release decisions use owned labels and effective settings Release workflows use owned pull request labels Nov 21, 2026
@MariusStorhaug Marius Storhaug (MariusStorhaug) changed the title Release workflows use owned pull request labels Release decisions use owned pull request labels Nov 21, 2026
Marius Storhaug (MariusStorhaug) added a commit to MSXOrg/docs that referenced this pull request Nov 21, 2026
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.
@MariusStorhaug Marius Storhaug (MariusStorhaug) changed the title Release decisions use owned pull request labels Release-GHRepository uses dedicated pull request labels Nov 21, 2026
@MariusStorhaug
Marius Storhaug (MariusStorhaug) marked this pull request as ready for review November 22, 2026 12:05
Copilot AI lite review requested due to automatic review settings November 22, 2026 12:05

Copilot AI 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.

🔵 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

Copilot AI lite review requested due to automatic review settings November 22, 2026 21:17

Copilot AI 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.

🟡 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

Comment thread .github/workflows/Release.yml Resolved
Comment thread README.md Resolved
Comment thread src/main.ps1 Resolved
Comment thread src/main.ps1 Resolved
Marius Storhaug (MariusStorhaug) added a commit to MSXOrg/docs that referenced this pull request Nov 23, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:major Publish a major release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resolve releases from owned labels and effective settings

2 participants