Repository navigation
Add the legacy release lane and a v2.0.3 baseline #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Marius Storhaug (MariusStorhaug)
merged 5 commits into
main
from
legacy-release-fixture-lane
Nov 30, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4d08886
Add legacy release fixture lane
MariusStorhaug 15b58b9
Require release:patch as the only legacy label
MariusStorhaug e6233b2
Verify the published v2.0.3 baseline without writes
MariusStorhaug e38f392
Check inventory reads and run the lane tests in the baseline job
MariusStorhaug 09a3ff6
Run the lane tests with Pester directly
MariusStorhaug File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| name: Legacy baseline | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main, 'integration/**'] | ||
| paths: | ||
| - '.github/workflows/Legacy-Baseline.yml' | ||
| - '.github/workflows/Legacy-Release-Test.yml' | ||
| - 'tests-baseline/**' | ||
| - 'tests/LegacyCase.psm1' | ||
| - 'tests/LegacyCase.Tests.ps1' | ||
| - 'tests/Invoke-LegacyFixture.ps1' | ||
| - 'tests/ReleaseInventory.psm1' | ||
|
|
||
| permissions: {} | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| LEGACY_ACTION_SHA: 750abed0ecab02394554b610dc3aa191e75e3248 # PSModule/Release-GHRepository v2.0.3 | ||
|
|
||
| jobs: | ||
| Simulated: | ||
| name: Run the pinned v2.0.3 logic against doubles | ||
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - name: Check out the fixture | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Check out the pinned legacy action | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| repository: PSModule/Release-GHRepository | ||
| ref: ${{ env.LEGACY_ACTION_SHA }} | ||
| path: .release-action | ||
| persist-credentials: false | ||
|
|
||
| - name: Install the modules the action uses | ||
| shell: pwsh | ||
| run: | | ||
| Install-PSResource -Name GitHub, PSSemVer, powershell-yaml -Repository PSGallery -TrustRepository | ||
| Get-Module GitHub, PSSemVer, powershell-yaml -ListAvailable | Format-Table Name, Version | ||
|
|
||
| - name: Test the baseline scenarios | ||
| uses: PSModule/Invoke-Pester@4ff33199141fdf22568990b6107fe3148ae93a1c # v5.1.0 | ||
| env: | ||
| LEGACY_ACTION_PATH: ${{ github.workspace }}/.release-action | ||
| with: | ||
| Path: tests-baseline | ||
| Version: 6.1.0 | ||
|
|
||
| - name: Test the legacy lane guard and verdict | ||
| shell: pwsh | ||
| run: | | ||
| Install-PSResource -Name Pester -Version 6.1.0 -Repository PSGallery -TrustRepository | ||
| Import-Module Pester -RequiredVersion 6.1.0 | ||
| $result = Invoke-Pester -Path tests/LegacyCase.Tests.ps1 -Output Detailed -PassThru | ||
| if ($result.FailedCount -gt 0 -or $result.TotalCount -eq 0) { throw 'The lane tests failed.' } | ||
|
|
||
| WhatIf: | ||
| name: Run the real composite in WhatIf mode with a read-only token | ||
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - name: Check out the fixture | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Check out the pinned legacy action | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| repository: PSModule/Release-GHRepository | ||
| ref: ${{ env.LEGACY_ACTION_SHA }} | ||
| path: .release-action | ||
| persist-credentials: false | ||
|
|
||
| - name: Record the release and tag inventory | ||
| id: before | ||
| shell: pwsh | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: | | ||
| $releases = gh api --paginate "repos/$env:GITHUB_REPOSITORY/releases" --jq '.[] | "\(.id) \(.tag_name)"' | ||
| if ($LASTEXITCODE -ne 0) { throw 'The release read failed.' } | ||
| $tags = gh api --paginate "repos/$env:GITHUB_REPOSITORY/tags" --jq '.[] | "\(.name) \(.commit.sha)"' | ||
|
MariusStorhaug marked this conversation as resolved.
Resolved
|
||
| if ($LASTEXITCODE -ne 0) { throw 'The tag read failed.' } | ||
| $state = @($releases) + @($tags) -join ';' | ||
| Add-Content -LiteralPath $env:GITHUB_OUTPUT -Value "state=$state" | ||
|
|
||
| - name: Preview with the legacy inputs | ||
| uses: ./.release-action | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| with: | ||
| AutoPatching: 'false' | ||
| AutoCleanup: 'false' | ||
| CreateMajorTag: 'false' | ||
| CreateMinorTag: 'false' | ||
| PatchLabels: release:patch | ||
| WhatIf: 'true' | ||
|
|
||
| - name: Confirm the preview wrote nothing | ||
| shell: pwsh | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| BEFORE: ${{ steps.before.outputs.state }} | ||
| run: | | ||
| $releases = gh api --paginate "repos/$env:GITHUB_REPOSITORY/releases" --jq '.[] | "\(.id) \(.tag_name)"' | ||
| if ($LASTEXITCODE -ne 0) { throw 'The release read failed.' } | ||
| $tags = gh api --paginate "repos/$env:GITHUB_REPOSITORY/tags" --jq '.[] | "\(.name) \(.commit.sha)"' | ||
| if ($LASTEXITCODE -ne 0) { throw 'The tag read failed.' } | ||
| $state = @($releases) + @($tags) -join ';' | ||
| if ($state -cne $env:BEFORE) { throw 'The WhatIf preview changed the release or tag inventory.' } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,172 @@ | ||
| name: Legacy release integration | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| types: [closed] | ||
|
|
||
| permissions: {} | ||
|
|
||
| concurrency: | ||
| group: Release-GHRepository-Test-Legacy | ||
| queue: max | ||
|
|
||
| jobs: | ||
| Select: | ||
| name: Verify the merged legacy case | ||
| if: >- | ||
| ${{ github.repository == 'PSModule/Release-GHRepository-Test-Legacy' | ||
| && github.event_name == 'pull_request' && github.event.action == 'closed' | ||
| && github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' | ||
| && github.event.pull_request.head.repo.id == github.event.pull_request.base.repo.id | ||
| && github.event.pull_request.head.repo.full_name == github.repository | ||
| && github.event.pull_request.base.repo.full_name == github.repository | ||
| && github.event.pull_request.user.id == 314722336 | ||
| && github.event.pull_request.user.login == 'psmodule-s-shelly[bot]' | ||
| && startsWith(github.event.pull_request.head.ref, 'release-fixture/') }} | ||
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| contents: read | ||
| pull-requests: read | ||
| outputs: | ||
| caseId: ${{ steps.fixture.outputs.caseId }} | ||
| candidate: ${{ steps.fixture.outputs.candidate }} | ||
| scenario: ${{ steps.fixture.outputs.scenario }} | ||
| pullRequest: ${{ steps.fixture.outputs.pullRequest }} | ||
| head: ${{ steps.fixture.outputs.head }} | ||
| source: ${{ steps.fixture.outputs.source }} | ||
| steps: | ||
| - name: Check out the exact squash commit | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| ref: ${{ github.event.pull_request.merge_commit_sha }} | ||
| persist-credentials: false | ||
|
|
||
| - name: Verify the case, squash commit, and author | ||
| id: fixture | ||
| shell: pwsh | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: ./tests/Invoke-LegacyFixture.ps1 -Stage Select | ||
|
|
||
| CI: | ||
| name: Test the exact squash commit | ||
| needs: Select | ||
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| contents: read | ||
| outputs: | ||
| testedSha: ${{ steps.source.outputs.sha }} | ||
| steps: | ||
| - name: Check out the exact squash commit | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| ref: ${{ needs.Select.outputs.source }} | ||
| persist-credentials: false | ||
|
|
||
| - name: Test case selection and inventory assertions | ||
| uses: PSModule/Invoke-Pester@4ff33199141fdf22568990b6107fe3148ae93a1c # v5.1.0 | ||
| with: | ||
| Path: tests | ||
| Version: 6.1.0 | ||
|
|
||
| - name: Record the tested SHA | ||
| id: source | ||
| shell: pwsh | ||
| env: | ||
| SOURCE: ${{ needs.Select.outputs.source }} | ||
| run: | | ||
| $sha = git rev-parse HEAD | ||
| if ($LASTEXITCODE -ne 0 -or $sha -cne $env:SOURCE) { | ||
| throw 'CI did not test the squash commit.' | ||
| } | ||
| Add-Content -LiteralPath $env:GITHUB_OUTPUT -Value "sha=$sha" | ||
|
|
||
| Gate: | ||
| name: Require current main and an empty inventory | ||
| needs: [Select, CI] | ||
| if: ${{ needs.CI.outputs.testedSha == needs.Select.outputs.source }} | ||
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| contents: read | ||
| outputs: | ||
| before: ${{ steps.gate.outputs.before }} | ||
| steps: | ||
| - name: Check out the exact squash commit | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| ref: ${{ needs.Select.outputs.source }} | ||
| persist-credentials: false | ||
|
|
||
| - name: Check main and the release and tag inventory | ||
| id: gate | ||
| shell: pwsh | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| FIXTURE_SOURCE: ${{ needs.Select.outputs.source }} | ||
| run: ./tests/Invoke-LegacyFixture.ps1 -Stage Gate | ||
|
|
||
| Publish: | ||
| name: Publish the legacy release | ||
| needs: [Select, CI, Gate] | ||
| if: ${{ needs.Gate.result == 'success' }} | ||
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| # The action runs git push origin --tags. Git needs the job token even when no local tag exists. | ||
| - name: Check out the exact squash commit with the job token | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| ref: ${{ needs.Select.outputs.source }} | ||
| persist-credentials: true | ||
|
|
||
| - name: Check main and the inventory again | ||
| shell: pwsh | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| FIXTURE_SOURCE: ${{ needs.Select.outputs.source }} | ||
| run: ./tests/Invoke-LegacyFixture.ps1 -Stage Gate | ||
|
|
||
| - name: Publish with the published legacy action | ||
| uses: PSModule/Release-GHRepository@750abed0ecab02394554b610dc3aa191e75e3248 # v2.0.3 | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| with: | ||
| AutoPatching: 'false' | ||
| AutoCleanup: 'false' | ||
| CreateMajorTag: 'false' | ||
| CreateMinorTag: 'false' | ||
| PatchLabels: release:patch | ||
| WhatIf: 'false' | ||
|
|
||
| Verify: | ||
| name: Verify the fixture result | ||
| needs: [Select, CI, Gate, Publish] | ||
| if: ${{ !cancelled() && needs.Select.result == 'success' }} | ||
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| steps: | ||
| - name: Check out the exact squash commit | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| ref: ${{ needs.Select.outputs.source }} | ||
| persist-credentials: false | ||
|
|
||
| - name: Verify and report the case | ||
| shell: pwsh | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| FIXTURE_CASE_ID: ${{ needs.Select.outputs.caseId }} | ||
| FIXTURE_CANDIDATE: ${{ needs.Select.outputs.candidate }} | ||
| FIXTURE_SCENARIO: ${{ needs.Select.outputs.scenario }} | ||
| FIXTURE_PR: ${{ needs.Select.outputs.pullRequest }} | ||
| FIXTURE_HEAD: ${{ needs.Select.outputs.head }} | ||
| FIXTURE_SOURCE: ${{ needs.Select.outputs.source }} | ||
| FIXTURE_BEFORE: ${{ needs.Gate.outputs.before }} | ||
| FIXTURE_CI: ${{ needs.CI.result }} | ||
| FIXTURE_TESTED_SHA: ${{ needs.CI.outputs.testedSha }} | ||
| FIXTURE_PUBLISH: ${{ needs.Publish.result }} | ||
| run: ./tests/Invoke-LegacyFixture.ps1 -Stage Verify |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.