Skip to content

Commit 67a0fcc

Browse files
committed
Move workflow failure to end
1 parent 98116f9 commit 67a0fcc

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

.github/workflows/check-changeset.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,8 @@ jobs:
5656
body: |
5757
### Changeset File Check :white_check_mark:
5858
- No modified packages are missing from the changeset file.
59-
- No changeset formatting errors detected.
59+
- No changeset formatting errors detected.
60+
# Don't want it to throw before editing the comment.
61+
- name: Fail if checker script logged a blocking failure
62+
if: ${{steps.check-changeset.outputs.BLOCKING_FAILURE}}
63+
run: exit 1

scripts/check_changeset.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ async function main() {
9898
.filter((line: string) => !line.includes('Command failed'))
9999
.filter((line: string) => !line.includes('exited with error code 1'))
100100
.join('%0A');
101+
/**
102+
* Sets Github Actions output for a step. Pass changeset error message to next
103+
* step. See:
104+
* https://github.com/actions/toolkit/blob/master/docs/commands.md#set-outputs
105+
*/
106+
console.log(`::set-output name=BLOCKING_FAILURE::true`);
101107
}
102108
try {
103109
const diffData = await getDiffData();
@@ -137,11 +143,7 @@ async function main() {
137143
missingPackagesError
138144
].join('%0A')}`
139145
);
140-
if (formattedStatusError) {
141-
process.exit(1);
142-
} else {
143-
process.exit();
144-
}
146+
process.exit();
145147
}
146148

147149
main();

0 commit comments

Comments
 (0)