Skip to content

Calculate release versions without publishing - #119

Merged
Marius Storhaug (MariusStorhaug) merged 3 commits into
release-decision-gatefrom
read-only-version-calculation
Nov 27, 2026
Merged

Marius Storhaug (MariusStorhaug) merged 3 commits into
release-decision-gatefrom
read-only-version-calculation

Conversation

@MariusStorhaug

Copy link
Copy Markdown
Member

Set Mode: calculate to validate a release decision and get a version without changing the repository. Existing callers stay in publish mode unless they opt in.

New: Read-only release version calculation

The action calculates a prerelease for an open pull request or a branch push that matches one. It calculates a stable version only on a push to the target repository's default branch.

Migration guide
  1. In a read-only job, set Mode: calculate on the action step. Use a token that can read pull requests and releases in the target repository.
  2. For a fork push or an ambiguous match, set PullRequest to OWNER/REPO#NUMBER. The action checks the source repository, branch, and commit before it uses the pull request.
  3. Read Decision and ReleaseVersion from the step outputs. A valid skip has no version. For a date-dependent prerelease, CalculatedAt gives the UTC instant used in the calculation. Do not pass ReleaseVersion to Version; that input still selects the GitHub module.
Technical details

This review covers only the Calculate mode and its outputs. The existing publisher uses the shared SemVer planner and keeps its pull request trigger and publication rules. The version input and the dedicated pull request check are separate work.

The new behavior tests failed before implementation. All 274 local Pester 6.1.0 tests passed, including 37 Calculate tests and 237 existing tests. The Calculate tests execute the action script with simulated GitHub reads and the real result writer. PowerShell lint passed for the source and changed tests. YAML lint passed for the action. No live publication was tested.

The scoped base is d7a7565228c29a799b645342ea5dec3cec872fc6 on release-decision-gate. This draft is for review only.

Related links

Pass an exact version from Calculate to Publish. Publish uses it only if
it matches the current release decision and target. Stable publication
requires a default-branch push. This draft does not change the
production release workflow.

<!-- ANNOUNCEMENT STOP -->

## Breaking: Stable publication requires a default-branch push

A pull request close can clean up prereleases, but cannot create a
stable release. Before you adopt this version, move any stable publisher
that runs on a pull request close to a default-branch push. The
production transition stays in #108.

## New: Publish an exact calculated version

Publish can use the unprefixed `ReleaseVersion` from Calculate on the
same event. Pass `CalculatedAt` unchanged for a date-dependent
prerelease. The GitHub module `Version` input does not change.

<details>
<summary>Migration guide</summary>

1. Run Calculate on the commit that you intend to publish. For a
prerelease, apply `release:prerelease` before Publish.
2. If Calculate reports `release`, pass `ReleaseVersion` and
`CalculatedAt` to Publish. Keep the same version settings. Use `WhatIf:
true` to preview without writes.
3. If you do not need a separate Calculate step, omit both inputs.
Publish calculates a version when the event qualifies.

</details>

<details>
<summary>Technical details</summary>

- Base: `read-only-version-calculation` at
`c7ec1533b970a676d69abc60127590136def82c0`. Head:
`25b682e998159736bcbd33ff4758d118537885ff`.
- Red: 24 local Pester 6.1.0 failures on the starting code, including an
ignored `ReleaseVersion` and a stable release attempted on PR close. The
[test-only hosted
run](https://github.com/PSModule/Release-GHRepository/actions/runs/46057399763)
also failed as expected.
- Green: 305 local Pester 6.1.0 tests passed with simulated writes. The
repository PowerShell analyzer and action YAML checks passed. Hosted
[Action-Test](https://github.com/PSModule/Release-GHRepository/actions/runs/46058615915)
and
[Linter](https://github.com/PSModule/Release-GHRepository/actions/runs/46058615939)
passed at the recorded head.
- `src/Get-EventReleasePlan.ps1` gives PR 4 the exact `.PullRequest`
that supplied the live labels, the resolved `.ReleaseDecision`, and the
version plan. The public Calculate outputs do not change.
- No live publication was attempted. This PR stays in draft pending
rollout coordination.

</details>

<details>
<summary>Related links</summary>

- Relates to #112
- Depends on #119

</details>
@MariusStorhaug
Marius Storhaug (MariusStorhaug) marked this pull request as ready for review November 27, 2026 22:11
@MariusStorhaug
Marius Storhaug (MariusStorhaug) merged commit 08cd936 into release-decision-gate Nov 27, 2026
16 checks passed
@MariusStorhaug
Marius Storhaug (MariusStorhaug) deleted the read-only-version-calculation branch November 27, 2026 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant