Skip to content

Commit bd00a98

Browse files
Jamesclaude
authored andcommitted
Let the red-master dry run prove issues:write
The dry run skipped every mutation, which left the one permission the workflow depends on untested until the moment master is already broken. Creating the label is idempotent, notifies nobody, and is needed before the first real failure anyway, so it now happens for real in both modes and reports whether the token could do it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtAbQJuygzhHiveuCxCPnT
1 parent ace8716 commit bd00a98

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

.github/scripts/red-master-issue.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,18 @@ failure|timed_out)
7171
if [ -z "$existing" ]; then
7272
# The label may not exist yet on a fresh repository. --force makes this
7373
# idempotent instead of failing the second time.
74-
run gh label create "$LABEL" \
75-
--color B60205 \
76-
--description "master is failing CI" \
77-
--force >/dev/null 2>&1 || true
74+
#
75+
# Deliberately NOT behind `run`: this is the one write a dry run still
76+
# makes. It notifies nobody and changes nothing anyone reads, and it is
77+
# the only way a dry run can prove the token really has issues:write --
78+
# which is the failure this whole workflow cannot afford, since it would
79+
# surface at exactly the moment master is already broken.
80+
if gh label create "$LABEL" --color B60205 \
81+
--description "master is failing CI" --force >/dev/null 2>&1; then
82+
say "label '$LABEL' exists (issues:write confirmed)"
83+
else
84+
say "::warning::could not create the '$LABEL' label; check the token's issues:write permission"
85+
fi
7886

7987
body="**\`$RUN_NAME\` failed on \`master\`.**
8088

0 commit comments

Comments
 (0)