Skip to content

Commit e08b519

Browse files
authored
More fixes for do-not-merge (#7274)
## Summary of changes Try to make the do-not-merge action a required job ## Reason for change For some mystical reason, the do_not_merge job runs on PRs, but I can't mark it as required. AI thinks this change will work. We'll see... ## Implementation details Move the decision on pass/fail to a separate job ## Test coverage This is the test, but I might have to merge it to be sure
1 parent 734e002 commit e08b519

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.github/workflows/do_not_merge.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Fail if 'status:do-not-merge' label is present
13+
id: check-label
1314
env:
1415
LABELS_JSON: ${{ toJson(github.event.pull_request.labels) }}
1516
run: |
@@ -20,8 +21,14 @@ jobs:
2021
2122
if [ "$MATCH" -gt 0 ]; then
2223
echo "Label 'status:do-not-merge' is present. Failing the job."
23-
exit 1
24+
echo "found=true" >> "$GITHUB_OUTPUT"
2425
else
2526
echo "Label 'status:do-not-merge' is NOT present. Passing."
26-
exit 0
27-
fi
27+
echo "found=false" >> "$GITHUB_OUTPUT"
28+
fi
29+
30+
- name: Fail if label is present
31+
if: steps.check-label.outputs.found == 'true'
32+
run: |
33+
echo "❌ Label 'status:do-not-merge' is present. Failing the job."
34+
exit 1

0 commit comments

Comments
 (0)