@@ -62,19 +62,22 @@ jobs:
6262 script : |
6363 const assert = require('node:assert');
6464
65+ const message = 'Test new ref commit';
6566 const refs = ['integration-test-playground-${{ github.run_id }}-${{ github.run_number }}', '${{ steps.commit-new-ref.outputs.sha }}'];
6667
6768 // Fetch the commit by both ref and sha
6869 for (const ref of refs) {
6970 const { data } = await github.rest.repos.getCommit({
7071 owner: context.repo.owner,
7172 repo: context.repo.repo,
72- ref: 'integration-test-playground-${{ github.run_id }}-${{ github.run_number }}' ,
73+ ref,
7374 });
7475
76+ assert.strictEqual('${{ steps.commit-new-ref.outputs.message }}', message, 'Expected correct message output');
77+ assert.strictEqual('${{ steps.commit-new-ref.outputs.ref }}', refs[0], 'Expected correct ref output');
7578 assert.strictEqual('${{ steps.commit-new-ref.outputs.ref-operation }}', 'created', 'Expected correct ref operation');
7679 assert.strictEqual(data.sha, '${{ steps.commit-new-ref.outputs.sha }}', 'Expected sha for commit to match');
77- assert.strictEqual(data.commit.message, 'Test new ref commit' , 'Expected commit message to match');
80+ assert.strictEqual(data.commit.message, message , 'Expected commit message to match');
7881 assert.strictEqual(data.commit.verification.verified, true, 'Expected commit to be verified');
7982 }
8083
@@ -107,19 +110,22 @@ jobs:
107110 script : |
108111 const assert = require('node:assert');
109112
113+ const message = 'Test updating existing ref';
110114 const refs = ['integration-test-playground-${{ github.run_id }}-${{ github.run_number }}', '${{ steps.update-existing-ref.outputs.sha }}'];
111115
112116 // Fetch the commit by both ref and sha
113117 for (const ref of refs) {
114118 const { data } = await github.rest.repos.getCommit({
115119 owner: context.repo.owner,
116120 repo: context.repo.repo,
117- ref: 'integration-test-playground-${{ github.run_id }}-${{ github.run_number }}' ,
121+ ref,
118122 });
119123
124+ assert.strictEqual('${{ steps.update-existing-ref.outputs.message }}', message, 'Expected correct message output');
125+ assert.strictEqual('${{ steps.update-existing-ref.outputs.ref }}', refs[0], 'Expected correct ref output');
120126 assert.strictEqual('${{ steps.update-existing-ref.outputs.ref-operation }}', 'updated', 'Expected correct ref operation');
121127 assert.strictEqual(data.sha, '${{ steps.update-existing-ref.outputs.sha }}', 'Expected sha for commit to match');
122- assert.strictEqual(data.commit.message, 'Test updating existing ref' , 'Expected commit message to match');
128+ assert.strictEqual(data.commit.message, message , 'Expected commit message to match');
123129 assert.strictEqual(data.commit.verification.verified, true, 'Expected commit to be verified');
124130 }
125131
@@ -146,19 +152,22 @@ jobs:
146152 script : |
147153 const assert = require('node:assert');
148154
155+ const message = 'Test updating existing ref (again)';
149156 const refs = ['integration-test-playground-${{ github.run_id }}-${{ github.run_number }}', '${{ steps.update-existing-ref-2.outputs.sha }}'];
150157
151158 // Fetch the commit by both ref and sha
152159 for (const ref of refs) {
153160 const { data } = await github.rest.repos.getCommit({
154161 owner: context.repo.owner,
155162 repo: context.repo.repo,
156- ref: 'integration-test-playground-${{ github.run_id }}-${{ github.run_number }}' ,
163+ ref,
157164 });
158165
166+ assert.strictEqual('${{ steps.update-existing-ref-2.outputs.message }}', message, 'Expected correct message output');
167+ assert.strictEqual('${{ steps.update-existing-ref-2.outputs.ref }}', refs[0], 'Expected correct ref output');
159168 assert.strictEqual('${{ steps.update-existing-ref-2.outputs.ref-operation }}', 'updated', 'Expected correct ref operation');
160169 assert.strictEqual(data.sha, '${{ steps.update-existing-ref-2.outputs.sha }}', 'Expected sha for commit to match');
161- assert.strictEqual(data.commit.message, 'Test updating existing ref (again)' , 'Expected commit message to match');
170+ assert.strictEqual(data.commit.message, message , 'Expected commit message to match');
162171 assert.strictEqual(data.commit.verification.verified, true, 'Expected commit to be verified');
163172 }
164173
@@ -200,19 +209,22 @@ jobs:
200209 script : |
201210 const assert = require('node:assert');
202211
212+ const message = 'Test updating existing ref (force)';
203213 const refs = ['integration-test-playground-${{ github.run_id }}-${{ github.run_number }}', '${{ steps.force-update-existing-ref.outputs.sha }}'];
204214
205215 // Fetch the commit by both ref and sha
206216 for (const ref of refs) {
207217 const { data } = await github.rest.repos.getCommit({
208218 owner: context.repo.owner,
209219 repo: context.repo.repo,
210- ref: 'integration-test-playground-${{ github.run_id }}-${{ github.run_number }}' ,
220+ ref,
211221 });
212222
223+ assert.strictEqual('${{ steps.force-update-existing-ref.outputs.message }}', message, 'Expected correct message output');
224+ assert.strictEqual('${{ steps.force-update-existing-ref.outputs.ref }}', refs[0], 'Expected correct ref output');
213225 assert.strictEqual('${{ steps.force-update-existing-ref.outputs.ref-operation }}', 'updated', 'Expected correct ref operation');
214226 assert.strictEqual(data.sha, '${{ steps.force-update-existing-ref.outputs.sha }}', 'Expected sha for commit to match');
215- assert.strictEqual(data.commit.message, 'Test updating existing ref (force)' , 'Expected commit message to match');
227+ assert.strictEqual(data.commit.message, message , 'Expected commit message to match');
216228 assert.strictEqual(data.commit.verification.verified, true, 'Expected commit to be verified');
217229 }
218230
0 commit comments