Skip to content

Commit d1eca54

Browse files
authored
Fix changeset checker to write to github output correctly (#7554)
1 parent 5dac8b3 commit d1eca54

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

scripts/ci/check_changeset.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,11 @@ async function main() {
124124
const errors = [];
125125
try {
126126
await exec(`yarn changeset status`);
127-
console.log(`"BLOCKING_FAILURE=false" >> $GITHUB_OUTPUT`);
127+
await exec(`echo "BLOCKING_FAILURE=false" >> $GITHUB_OUTPUT`);
128128
} catch (e) {
129129
const error = e as Error;
130130
if (error.message.match('No changesets present')) {
131-
console.log(`"BLOCKING_FAILURE=false" >> $GITHUB_OUTPUT`);
131+
await exec(`echo "BLOCKING_FAILURE=false" >> $GITHUB_OUTPUT`);
132132
} else {
133133
const messageLines = error.message.replace(/🦋 error /g, '').split('\n');
134134
let formattedStatusError =
@@ -147,9 +147,9 @@ async function main() {
147147
/**
148148
* Sets Github Actions output for a step. Pass changeset error message to next
149149
* step. See:
150-
* https://github.com/actions/toolkit/blob/master/docs/commands.md#set-outputs
150+
* https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter
151151
*/
152-
console.log(`"BLOCKING_FAILURE=true" >> $GITHUB_OUTPUT`);
152+
await exec(`echo "BLOCKING_FAILURE=true" >> $GITHUB_OUTPUT`);
153153
}
154154
}
155155

@@ -185,13 +185,13 @@ async function main() {
185185
`- Package ${bumpPackage} has a ${bumpText} bump which requires an ` +
186186
`additional line to bump the main "firebase" package to ${bumpText}.`
187187
);
188-
console.log(`"BLOCKING_FAILURE=true" >> $GITHUB_OUTPUT`);
188+
await exec(`echo "BLOCKING_FAILURE=true" >> $GITHUB_OUTPUT`);
189189
} else if (bumpRank[changesetPackages['firebase']] < highestBump) {
190190
errors.push(
191191
`- Package ${bumpPackage} has a ${bumpText} bump. ` +
192192
`Increase the bump for the main "firebase" package to ${bumpText}.`
193193
);
194-
console.log(`"BLOCKING_FAILURE=true" >> $GITHUB_OUTPUT`);
194+
await exec(`echo "BLOCKING_FAILURE=true" >> $GITHUB_OUTPUT`);
195195
}
196196
}
197197
}
@@ -203,11 +203,11 @@ async function main() {
203203
/**
204204
* Sets Github Actions output for a step. Pass changeset error message to next
205205
* step. See:
206-
* https://github.com/actions/toolkit/blob/master/docs/commands.md#set-outputs
206+
* https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter
207207
*/
208208
if (errors.length > 0)
209-
console.log(
210-
`"CHANGESET_ERROR_MESSAGE=${errors.join('%0A')}" >> $GITHUB_OUTPUT`
209+
await exec(
210+
`echo "CHANGESET_ERROR_MESSAGE=${errors.join('%0A')}" >> $GITHUB_OUTPUT`
211211
);
212212
process.exit();
213213
}

0 commit comments

Comments
 (0)