From da1981ab7694353c872abbf7d856ea2b0929e61a Mon Sep 17 00:00:00 2001 From: Gerrrt Date: Sat, 28 Nov 2026 19:59:16 -0800 Subject: [PATCH] ci(audit): add the audit label separately, with retries gh pr create adds a label in a second call once the PR exists. A transient GraphQL error there failed run 46213501517 although #1818 was already open. Create the PR without the label, then add it with gh pr edit, retrying after 5, 15 and 45 seconds, and only warn if it never sticks. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/weekly-audit.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/weekly-audit.yml b/.github/workflows/weekly-audit.yml index 4961494f..696dc5dd 100644 --- a/.github/workflows/weekly-audit.yml +++ b/.github/workflows/weekly-audit.yml @@ -284,7 +284,19 @@ jobs: if [ -n "$open_pr" ]; then gh pr edit "$open_pr" --body-file "$body" else + # No --label here: gh adds it in a second call once the PR + # exists, and a GitHub error in that call failed a run whose PR + # was already open. The label goes on below, with retries. gh pr create --base main --head "$BRANCH" \ --title "docs(audit): weekly doc fixes $WEEK, focus $FOCUS" \ - --body-file "$body" --label audit + --body-file "$body" fi + for delay in 5 15 45 0; do + if gh pr edit "$BRANCH" --add-label audit; then + exit 0 + fi + [ "$delay" -eq 0 ] && break + echo "Adding the audit label failed; retrying in ${delay}s" + sleep "$delay" + done + echo "::warning::The PR is open but the audit label could not be added; add it by hand."