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."