11name : Integration Tests
22
33on :
4+ workflow_call :
45 workflow_dispatch :
5- workflow_run :
6- workflows : ['CI']
7- branches :
8- - main
9- - ' releases/*'
10- types :
11- - completed
12- schedule :
13- - cron : ' 0 22 * * 3'
14-
15- permissions :
16- contents : read
6+
7+ permissions : {}
178
189jobs :
1910 integration-tests :
2011 name : Integration Test
2112 runs-on : ubuntu-latest
2213 permissions :
2314 contents : write
24- if : ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
2515
2616 steps :
2717 - name : Checkout
2818 id : checkout
2919 uses : actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
20+ with :
21+ persist-credentials : false
3022
3123 - name : Make note of the branch name
3224 id : branch-name
@@ -61,13 +53,18 @@ jobs:
6153
6254 - name : Confirm new ref commit
6355 uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
56+ env :
57+ MESSAGE : ${{ steps.commit-new-ref.outputs.message }}
58+ REF : ${{ steps.commit-new-ref.outputs.ref }}
59+ REF_OPERATION : ${{ steps.commit-new-ref.outputs.ref-operation }}
60+ SHA : ${{ steps.commit-new-ref.outputs.sha }}
6461 with :
6562 github-token : ${{ steps.generate-token.outputs.token }}
6663 script : |
6764 const assert = require('node:assert');
6865
6966 const message = 'Test new ref commit';
70- const refs = ['integration-test-playground-${{ github.run_id }}-${{ github.run_number }}', '${{ steps.commit-new-ref.outputs.sha }}' ];
67+ const refs = ['integration-test-playground-${{ github.run_id }}-${{ github.run_number }}', process.env.SHA ];
7168
7269 // Fetch the commit by both ref and sha
7370 for (const ref of refs) {
@@ -77,10 +74,10 @@ jobs:
7774 ref,
7875 });
7976
80- assert.strictEqual('${{ steps.commit-new-ref.outputs.message }}' , message, 'Expected correct message output');
81- assert.strictEqual('${{ steps.commit-new-ref.outputs.ref }}' , refs[0], 'Expected correct ref output');
82- assert.strictEqual('${{ steps.commit-new-ref.outputs.ref-operation }}' , 'created', 'Expected correct ref operation');
83- assert.strictEqual(data.sha, '${{ steps.commit-new-ref.outputs.sha }}' , 'Expected sha for commit to match');
77+ assert.strictEqual(process.env.MESSAGE , message, 'Expected correct message output');
78+ assert.strictEqual(process.env.REF , refs[0], 'Expected correct ref output');
79+ assert.strictEqual(process.env.REF_OPERATION , 'created', 'Expected correct ref operation');
80+ assert.strictEqual(data.sha, process.env.SHA , 'Expected sha for commit to match');
8481 assert.strictEqual(data.commit.message, message, 'Expected commit message to match');
8582 assert.strictEqual(data.commit.verification.verified, true, 'Expected commit to be verified');
8683
@@ -121,13 +118,18 @@ jobs:
121118
122119 - name : Confirm existing ref commit
123120 uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
121+ env :
122+ MESSAGE : ${{ steps.update-existing-ref.outputs.message }}
123+ REF : ${{ steps.update-existing-ref.outputs.ref }}
124+ REF_OPERATION : ${{ steps.update-existing-ref.outputs.ref-operation }}
125+ SHA : ${{ steps.update-existing-ref.outputs.sha }}
124126 with :
125127 github-token : ${{ steps.generate-token.outputs.token }}
126128 script : |
127129 const assert = require('node:assert');
128130
129131 const message = 'Test updating existing ref';
130- const refs = ['integration-test-playground-${{ github.run_id }}-${{ github.run_number }}', '${{ steps.update-existing-ref.outputs.sha }}' ];
132+ const refs = ['integration-test-playground-${{ github.run_id }}-${{ github.run_number }}', process.env.SHA ];
131133
132134 // Fetch the commit by both ref and sha
133135 for (const ref of refs) {
@@ -137,10 +139,10 @@ jobs:
137139 ref,
138140 });
139141
140- assert.strictEqual('${{ steps.update-existing-ref.outputs.message }}' , message, 'Expected correct message output');
141- assert.strictEqual('${{ steps.update-existing-ref.outputs.ref }}' , refs[0], 'Expected correct ref output');
142- assert.strictEqual('${{ steps.update-existing-ref.outputs.ref-operation }}' , 'updated', 'Expected correct ref operation');
143- assert.strictEqual(data.sha, '${{ steps.update-existing-ref.outputs.sha }}' , 'Expected sha for commit to match');
142+ assert.strictEqual(process.env.MESSAGE , message, 'Expected correct message output');
143+ assert.strictEqual(process.env.REF , refs[0], 'Expected correct ref output');
144+ assert.strictEqual(process.env.REF_OPERATION , 'updated', 'Expected correct ref operation');
145+ assert.strictEqual(data.sha, process.env.SHA , 'Expected sha for commit to match');
144146 assert.strictEqual(data.commit.message, message, 'Expected commit message to match');
145147 assert.strictEqual(data.commit.verification.verified, true, 'Expected commit to be verified');
146148 }
@@ -163,13 +165,18 @@ jobs:
163165
164166 - name : Confirm existing ref commit
165167 uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
168+ env :
169+ MESSAGE : ${{ steps.update-existing-ref-2.outputs.message }}
170+ REF : ${{ steps.update-existing-ref-2.outputs.ref }}
171+ REF_OPERATION : ${{ steps.update-existing-ref-2.outputs.ref-operation }}
172+ SHA : ${{ steps.update-existing-ref-2.outputs.sha }}
166173 with :
167174 github-token : ${{ steps.generate-token.outputs.token }}
168175 script : |
169176 const assert = require('node:assert');
170177
171178 const message = 'Test updating existing ref (again)';
172- const refs = ['integration-test-playground-${{ github.run_id }}-${{ github.run_number }}', '${{ steps.update-existing-ref-2.outputs.sha }}' ];
179+ const refs = ['integration-test-playground-${{ github.run_id }}-${{ github.run_number }}', process.env.SHA ];
173180
174181 // Fetch the commit by both ref and sha
175182 for (const ref of refs) {
@@ -179,10 +186,10 @@ jobs:
179186 ref,
180187 });
181188
182- assert.strictEqual('${{ steps.update-existing-ref-2.outputs.message }}' , message, 'Expected correct message output');
183- assert.strictEqual('${{ steps.update-existing-ref-2.outputs.ref }}' , refs[0], 'Expected correct ref output');
184- assert.strictEqual('${{ steps.update-existing-ref-2.outputs.ref-operation }}' , 'updated', 'Expected correct ref operation');
185- assert.strictEqual(data.sha, '${{ steps.update-existing-ref-2.outputs.sha }}' , 'Expected sha for commit to match');
189+ assert.strictEqual(process.env.MESSAGE , message, 'Expected correct message output');
190+ assert.strictEqual(process.env.REF , refs[0], 'Expected correct ref output');
191+ assert.strictEqual(process.env.REF_OPERATION , 'updated', 'Expected correct ref operation');
192+ assert.strictEqual(data.sha, process.env.SHA , 'Expected sha for commit to match');
186193 assert.strictEqual(data.commit.message, message, 'Expected commit message to match');
187194 assert.strictEqual(data.commit.verification.verified, true, 'Expected commit to be verified');
188195 }
@@ -202,7 +209,9 @@ jobs:
202209 token : ${{ steps.generate-token.outputs.token }}
203210
204211 - name : Switch back to base branch
205- run : git switch ${{ steps.branch-name.outputs.BRANCH }}
212+ env :
213+ BRANCH : ${{ steps.branch-name.outputs.BRANCH }}
214+ run : git switch $BRANCH
206215
207216 - name : Make changes to commit and stage them
208217 run : |
@@ -220,13 +229,18 @@ jobs:
220229
221230 - name : Confirm forced commit
222231 uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
232+ env :
233+ MESSAGE : ${{ steps.force-update-existing-ref.outputs.message }}
234+ REF : ${{ steps.force-update-existing-ref.outputs.ref }}
235+ REF_OPERATION : ${{ steps.force-update-existing-ref.outputs.ref-operation }}
236+ SHA : ${{ steps.force-update-existing-ref.outputs.sha }}
223237 with :
224238 github-token : ${{ steps.generate-token.outputs.token }}
225239 script : |
226240 const assert = require('node:assert');
227241
228242 const message = 'Test updating existing ref (force)';
229- const refs = ['integration-test-playground-${{ github.run_id }}-${{ github.run_number }}', '${{ steps.force-update-existing-ref.outputs.sha }}' ];
243+ const refs = ['integration-test-playground-${{ github.run_id }}-${{ github.run_number }}', process.env.SHA ];
230244
231245 // Fetch the commit by both ref and sha
232246 for (const ref of refs) {
@@ -236,10 +250,10 @@ jobs:
236250 ref,
237251 });
238252
239- assert.strictEqual('${{ steps.force-update-existing-ref.outputs.message }}' , message, 'Expected correct message output');
240- assert.strictEqual('${{ steps.force-update-existing-ref.outputs.ref }}' , refs[0], 'Expected correct ref output');
241- assert.strictEqual('${{ steps.force-update-existing-ref.outputs.ref-operation }}' , 'updated', 'Expected correct ref operation');
242- assert.strictEqual(data.sha, '${{ steps.force-update-existing-ref.outputs.sha }}' , 'Expected sha for commit to match');
253+ assert.strictEqual(process.env.MESSAGE , message, 'Expected correct message output');
254+ assert.strictEqual(process.env.REF , refs[0], 'Expected correct ref output');
255+ assert.strictEqual(process.env.REF_OPERATION , 'updated', 'Expected correct ref operation');
256+ assert.strictEqual(data.sha, process.env.SHA , 'Expected sha for commit to match');
243257 assert.strictEqual(data.commit.message, message, 'Expected commit message to match');
244258 assert.strictEqual(data.commit.verification.verified, true, 'Expected commit to be verified');
245259 }
0 commit comments