Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
ee24a8d
Add canonical release decision resolver
MariusStorhaug Aug 28, 2026
8071946
Enforce namespaced release decisions
MariusStorhaug Aug 28, 2026
d7b5359
Run release checks on label transitions
MariusStorhaug Aug 28, 2026
c17172a
Document the v3 release label contract
MariusStorhaug Aug 28, 2026
8e4578b
Cover the complete release label matrix
MariusStorhaug Aug 28, 2026
0a8c09a
Keep release checks safe for dry runs and forks
MariusStorhaug Aug 28, 2026
a2ec196
Restrict prereleases to open pull requests
MariusStorhaug Aug 28, 2026
efc2b38
Scope release concurrency to each pull request
MariusStorhaug Aug 28, 2026
be73e64
Document the trusted release trigger
MariusStorhaug Aug 28, 2026
a1c6728
Resolve unlabeled releases from DefaultBump
MariusStorhaug Aug 29, 2026
9f13a19
Expose DefaultBump in the action contract
MariusStorhaug Aug 29, 2026
a3b76e0
Document DefaultBump precedence and migration
MariusStorhaug Aug 29, 2026
fd25814
Preserve terminating native command failures
MariusStorhaug Aug 29, 2026
2c19496
Apply the patch default consistently
MariusStorhaug Aug 29, 2026
9d0b79c
Target prereleases at the pull request head
MariusStorhaug Aug 29, 2026
e3d91ea
Render concrete dry-run comment commands
MariusStorhaug Aug 29, 2026
eb79780
Fail clearly on invalid prerelease context
MariusStorhaug Aug 29, 2026
0265cf5
Use the release prerelease qualifier
MariusStorhaug Sep 4, 2026
2f55615
Document the release prerelease qualifier
MariusStorhaug Sep 4, 2026
bae3d66
Restrict cleanup to matching prereleases
MariusStorhaug Sep 4, 2026
ed54c8f
Resolve effective settings without losing explicit overrides
MariusStorhaug Oct 31, 2026
a71f7d1
Exercise the release caller without repository mutations
MariusStorhaug Oct 31, 2026
8fac168
Add explicit caller overrides and release-decision provenance
MariusStorhaug Oct 31, 2026
89b7766
Preserve valid release contexts and queue stable publication
MariusStorhaug Oct 31, 2026
b8767c4
Match cleanup identities exactly and keep skip version-free
MariusStorhaug Oct 31, 2026
4007dbe
Read canonical release settings and reject legacy paths
MariusStorhaug Nov 1, 2026
03e20b8
Document the canonical release settings reader
MariusStorhaug Nov 1, 2026
3e1b28e
Separate the filename migration from owned release decisions
MariusStorhaug Nov 13, 2026
37d7539
Use named inputs for explicit release-setting overrides
MariusStorhaug Nov 15, 2026
47202d7
Explain inherited named action settings
MariusStorhaug Nov 15, 2026
2fc7c58
Rename the settings path input to SettingsFilePath
MariusStorhaug Nov 15, 2026
d190349
Exercise an existing caller settings file in the hosted test
MariusStorhaug Nov 15, 2026
9e1c370
Use file-backed release standards and natural input omission
MariusStorhaug Nov 15, 2026
a28d7a6
Keep automatic bump policy in the settings file
MariusStorhaug Nov 15, 2026
714b801
Keep discoverable release standards in action metadata
MariusStorhaug Nov 15, 2026
7ab87bc
Resolve startup settings before GitHub-Script
MariusStorhaug Nov 16, 2026
1040867
Exercise resolved startup inputs in the read-only caller
MariusStorhaug Nov 16, 2026
290d112
Tag stable releases at the merged commit
MariusStorhaug Nov 22, 2026
4aa6e36
Keep release publishing on pull request events
MariusStorhaug Nov 22, 2026
bc4449b
Explain the trust gate for fork prereleases
MariusStorhaug Nov 22, 2026
48a4319
Preserve pull request workflow guidance from main
MariusStorhaug Nov 22, 2026
6eba7b7
Keep release action guidance evergreen
MariusStorhaug Nov 23, 2026
85a43b0
Document the release-note handoff
MariusStorhaug Nov 24, 2026
4a8ce5f
Use namespaced release label terminology
MariusStorhaug Nov 24, 2026
fa4b27e
Clarify the release upgrade and limit publisher permissions
MariusStorhaug Nov 24, 2026
6cf328b
Require an explicit release decision by default (#118)
MariusStorhaug Nov 27, 2026
00b61f1
Provision release labels before publishing prereleases
MariusStorhaug Nov 27, 2026
15b4e64
Pin reviewed release jobs to Ubuntu 24.04
MariusStorhaug Nov 27, 2026
a9288a7
Bind release plans to the exact source and decision
MariusStorhaug Nov 28, 2026
269e72e
Run release planning and CI before stable publication
MariusStorhaug Nov 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 89 additions & 8 deletions .github/workflows/Action-Test.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,113 @@
name: Action-Test

run-name: "Action-Test - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
run-name: "Action-Test - [${{ github.ref_name }}] by @${{ github.actor }}"

on:
workflow_dispatch:
pull_request:
workflow_call:
schedule:
- cron: '0 0 * * *'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-tests-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read
pull-requests: read
permissions: {}

jobs:
UnitTest:
name: Pester 6.1
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- name: Checkout repo
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: ${{ github.sha }}
persist-credentials: false

- name: Test release decisions
uses: PSModule/Invoke-Pester@4ff33199141fdf22568990b6107fe3148ae93a1c # v5.1.0
with:
Path: tests
Version: 6.1.0
Prescript: |
Install-PSResource -Name powershell-yaml -Version '[0.4.12]' -TrustRepository -Repository PSGallery
Install-PSResource -Name PSSemVer -Version '[1.1.10]' -TrustRepository -Repository PSGallery

ActionTestDefault:
name: Action-Test - [Default]
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
permissions:
contents: read
pull-requests: read
steps:
- name: Checkout repo
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: ${{ github.sha }}
persist-credentials: false

- name: Action-Test
uses: ./
with:
DefaultBump: patch
WhatIf: true

- name: Prepare caller settings
id: caller-settings
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$settingsFilePath = Join-Path -Path $env:RUNNER_TEMP -ChildPath 'release-caller.settings.yml'
@'
DefaultBump: major
AutoCleanup: true
CreateMajorTag: false
DatePrereleaseFormat: yyyyMMdd
VersionPrefix: v
WhatIf: false
Debug: true
Verbose: true
WorkingDirectory: .github
Version: '[0.43.1]'
Prerelease: true
'@ | Set-Content -LiteralPath $settingsFilePath
"path=$settingsFilePath" | Add-Content -LiteralPath $env:GITHUB_OUTPUT

- name: Action-Test - Repository policy
uses: ./
with:
SettingsFilePath: ${{ steps.caller-settings.outputs.path }}
AutoCleanup: false
DatePrereleaseFormat: ''
VersionPrefix: ''
Debug: ''
Verbose: ''
WorkingDirectory: ''
Version: ''
Prerelease: ''
WhatIf: true

- name: Action-Test - Explicit standard-value override
uses: ./
with:
SettingsFilePath: ${{ steps.caller-settings.outputs.path }}
DefaultBump: patch
AutoCleanup: false
DatePrereleaseFormat: ''
VersionPrefix: ''
Debug: false
Verbose: false
WorkingDirectory: ${{ github.workspace }}
Version: '[0.43.1]'
Prerelease: false
WhatIf: true

- name: Remove caller settings
if: ${{ always() && steps.caller-settings.outputs.path != '' }}
shell: pwsh
env:
CALLER_SETTINGS_PATH: ${{ steps.caller-settings.outputs.path }}
run: Remove-Item -LiteralPath $env:CALLER_SETTINGS_PATH -ErrorAction Stop
82 changes: 82 additions & 0 deletions .github/workflows/Release-Decision.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Release decision

on:
workflow_call:
outputs:
Decision:
description: The release or skip decision.
value: ${{ jobs.ReleaseDecision.outputs.Decision }}
ReleaseVersion:
description: The calculated version, if the decision is release.
value: ${{ jobs.ReleaseDecision.outputs.ReleaseVersion }}
ReleasePlan:
description: The source-bound handoff to Publish, if the decision is release.
value: ${{ jobs.ReleaseDecision.outputs.ReleasePlan }}

permissions:
contents: read
pull-requests: read

jobs:
ReleaseDecision:
name: Release decision
runs-on: ubuntu-24.04
outputs:
Decision: ${{ steps.calculate.outputs.Decision }}
ReleaseVersion: ${{ steps.calculate.outputs.ReleaseVersion }}
ReleasePlan: ${{ steps.calculate.outputs.ReleasePlan }}
steps:
- name: Check out the revision under test
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: ${{ github.sha }}
persist-credentials: false

- name: Verify the pull request snapshot
if: ${{ github.event_name == 'pull_request' }}
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
run: $null = & '.\src\Test-ReleaseDecisionContext.ps1'

- name: Calculate the release decision
id: calculate
uses: ./
env:
PSMODULE_AUTO_RELEASE_CHECK_PUBLISHER: 'true'
with:
Mode: calculate

- name: Recheck and report the decision
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
RELEASE_DECISION: ${{ steps.calculate.outputs.Decision }}
RELEASE_VERSION: ${{ steps.calculate.outputs.ReleaseVersion }}
RELEASE_PLAN: ${{ steps.calculate.outputs.ReleasePlan }}
RELEASE_BUMP_SOURCE: ${{ steps.calculate.outputs.BumpSource }}
run: |
$ErrorActionPreference = 'Stop'
$decision = $env:RELEASE_DECISION
$version = $env:RELEASE_VERSION
$source = $env:RELEASE_BUMP_SOURCE
$hasVersion = -not [string]::IsNullOrWhiteSpace($version)
$hasPlan = -not [string]::IsNullOrWhiteSpace($env:RELEASE_PLAN)
if ($decision -cnotin @('release', 'skip') -or -not $source -or
($decision -ceq 'release') -ne $hasVersion -or $hasVersion -ne $hasPlan) {
throw 'Calculate did not return a complete release decision.'
}
$summary = [ordered]@{
SourceSha = $env:GITHUB_SHA
Decision = $decision
BumpSource = $source
Version = $version
}
if ($env:GITHUB_EVENT_NAME -ceq 'pull_request') {
$checked = & '.\src\Test-ReleaseDecisionContext.ps1'
$summary.PullRequest = $checked.Number
$summary.BaseBranch = $checked.BaseRef
$summary.BaseSha = $checked.BaseSha
$summary.HeadSha = $checked.HeadSha
}
$summary | ConvertTo-Json
89 changes: 78 additions & 11 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: Release

run-name: "Release - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
run-name: "Release - [${{ github.event.pull_request.title || github.ref_name }}] by @${{ github.actor }}"

on:
push:
branches:
- main
pull_request:
branches:
- main
Expand All @@ -12,25 +15,89 @@ on:
- reopened
- synchronize
- labeled
paths:
- 'action.yml'
- 'src/**'
- unlabeled
- edited

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: false

permissions:
contents: write # Required to create releases
pull-requests: write # Required to create comments on the PRs
permissions: {}

jobs:
Plan:
name: Plan
if: ${{ github.event_name == 'push' || github.event.action != 'closed' }}
uses: ./.github/workflows/Release-Decision.yml
permissions:
contents: read
pull-requests: read

CI:
name: CI
if: ${{ github.event_name == 'push' || github.event.action != 'closed' }}
uses: ./.github/workflows/Action-Test.yml
permissions:
contents: read
pull-requests: read

PublishStable:
name: Publish stable
needs: [Plan, CI]
if: >-
${{ github.event_name == 'push' && github.ref_name == github.event.repository.default_branch
&& needs.Plan.outputs.Decision == 'release' }}
runs-on: ubuntu-24.04
permissions:
contents: write # Create the release and its tags
pull-requests: read # Verify the merged pull request and its release decision
steps:
- name: Check out the tested commit
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: ${{ github.sha }}
persist-credentials: false

- name: Require the calculated plan
shell: pwsh
env:
RELEASE_PLAN: ${{ needs.Plan.outputs.ReleasePlan }}
run: |
if ([string]::IsNullOrWhiteSpace($env:RELEASE_PLAN)) {
throw 'A release decision requires a plan from the Plan job.'
}

- name: Publish the tested release
uses: ./
with:
Mode: publish
ReleasePlan: ${{ needs.Plan.outputs.ReleasePlan }}

Release:
runs-on: ubuntu-latest
name: Prerelease and cleanup
needs: [Plan, CI]
if: >-
${{ !cancelled() && github.event_name == 'pull_request'
Comment thread
MariusStorhaug marked this conversation as resolved.
Resolved
&& github.event.pull_request.head.repo.full_name == github.repository
&& (github.event.action == 'closed' || (github.event.action != 'edited'
&& needs.Plan.result == 'success' && needs.Plan.outputs.Decision == 'release' && needs.CI.result == 'success'
&& contains(github.event.pull_request.labels.*.name, 'release:prerelease'))) }}
runs-on: ubuntu-24.04
permissions:
contents: write # Create prereleases and clean up their tags
pull-requests: write # Manage release labels and comment on pull requests
steps:
- name: Require the merge commit SHA
if: ${{ github.event.action == 'closed' && github.event.pull_request.merged && !github.event.pull_request.merge_commit_sha }}
shell: pwsh
run: throw 'GitHub did not report the merge commit SHA.'

- name: Checkout repo
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: >-
${{ github.event.action == 'closed' && github.event.pull_request.merged
&& github.event.pull_request.merge_commit_sha || github.event.pull_request.base.sha }}
persist-credentials: false
Comment thread
MariusStorhaug marked this conversation as resolved.
Resolved

- name: Release
Expand Down
Loading
Loading