@@ -26,12 +26,32 @@ jobs:
2626 const tag = `test-release-create-${context.runId}-${context.runAttempt}`;
2727 core.setOutput('tag', tag);
2828
29+ // A release fixture must not introduce workflows relative to a moving main.
30+ // Keep the checked-out action code, but omit workflows from the target tree.
31+ const { data: source } = await github.rest.git.getCommit({
32+ ...context.repo,
33+ commit_sha: context.sha,
34+ });
35+ const { data: tree } = await github.rest.git.createTree({
36+ ...context.repo,
37+ base_tree: source.tree.sha,
38+ tree: [{ path: '.github/workflows', mode: '040000', type: 'tree', sha: null }],
39+ });
40+ const { data: fixture } = await github.rest.git.createCommit({
41+ ...context.repo,
42+ message: `test: release fixture for ${context.runId}/${context.runAttempt}`,
43+ tree: tree.sha,
44+ parents: [context.sha],
45+ });
46+ // No branch is created or moved. Only the disposable release tags reference this commit.
47+ core.setOutput('target-sha', fixture.sha);
48+
2949 - name : Act - Create explicit draft release
3050 id : create-release
3151 uses : $/actions/release/create
3252 with :
3353 tag : ${{ steps.test-release.outputs.tag }}
34- target-ref : ${{ github. sha }}
54+ target-ref : ${{ steps.test-release.outputs.target- sha }}
3555 config-overrides : |
3656 name-template: Configured release
3757 prerelease : " true"
4464 env :
4565 CREATED_TAG : ${{ steps.test-release.outputs.tag }}
4666 OUTPUT_TAG : ${{ steps.create-release.outputs.tag }}
47- EXPECTED_RELEASE_SHA : ${{ github. sha }}
67+ EXPECTED_RELEASE_SHA : ${{ steps.test-release.outputs.target- sha }}
4868 with :
4969 github-token : ${{ github.token }}
5070 script : |
@@ -163,7 +183,7 @@ jobs:
163183 env :
164184 RELEASE_ID : ${{ steps.draft-release.outputs.release-id }}
165185 EXPECTED_TAG : ${{ steps.test-release.outputs.tag }}
166- EXPECTED_SHA : ${{ github. sha }}
186+ EXPECTED_SHA : ${{ steps.test-release.outputs.target- sha }}
167187 with :
168188 script : |
169189 const assert = require('node:assert/strict');
0 commit comments