Skip to content

ci(audit): add the audit label separately, with retries - #1823

Merged
Gerrrt merged 1 commit into
mainfrom
ci/weekly-audit-label-retry
Nov 29, 2026
Merged

Gerrrt merged 1 commit into
mainfrom
ci/weekly-audit-label-retry

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Nov 29, 2026

Copy link
Copy Markdown
Owner

What changed

.github/workflows/weekly-audit.yml, step Commit, push branch, open PR:

  • gh pr create no longer passes --label audit.
  • After the PR is created or updated, a loop adds the label with
    gh pr edit "$BRANCH" --add-label audit, retrying after 5, 15 and 45
    seconds. If all four tries fail, the step writes a warning annotation and
    still succeeds, because the PR is already open.

Why

Run 46213501517 (focus 0) opened #1818 and then failed. gh pr create adds a
label in a second API call after the PR exists, and that call got a transient
GitHub GraphQL error. The run was marked failed even though its PR was open,
and the PR had no audit label.

Blast radius

CI only: one step of the weekly audit workflow. No host, VLAN or service
changes.

  • No change to network segmentation or firewall rules
  • No new port published to a VLAN that could not already reach the service
  • No credential added outside secrets/*.sops.yaml

Verification

  • actionlint, zizmor and yamllint pass on the workflow
  • The retry loop, run against a stub gh under set -euo pipefail,
    succeeds on the first try, succeeds on the third, and gives up with a
    warning and exit 0 after four failures
  • Next audit run that opens a PR shows the label applied

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
@Gerrrt
Gerrrt merged commit b908b79 into main Nov 29, 2026
9 checks passed
@Gerrrt
Gerrrt deleted the ci/weekly-audit-label-retry branch November 29, 2026 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant