From bebe0da6d776886b01127b4e4fa490691399b0cf Mon Sep 17 00:00:00 2001 From: Wynne Pirini Date: Thu, 22 Oct 2026 09:36:21 +1300 Subject: [PATCH] ci(audit): run on pull requests, and stop Scorecard failing off main Two problems, one root cause: the audit signal arrived too late and was partly unreadable. 1. audit.yml only ran on push to main, weekly, and manually. GO-2026-6809 in the Go stdlib therefore sat undetected until it was already on main and the clean-security-scan claim was already false. It now also runs on pull_request, so that class is caught before merge. 2. The OpenSSF Scorecard job fails on any ref but the default branch ("Only the default branch main is supported"). That made a workflow_dispatch on a feature branch go red for a reason unrelated to the code, hiding the real result from the claims guard, which is the only way to verify a toolchain bump before merging. The job is now gated to main; schedule and push to main still run it. No change to what any scan checks, only when it runs and which refs Scorecard accepts. --- .github/workflows/audit.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index ca26b2cd..76e44df2 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -8,6 +8,11 @@ name: Audit on: push: branches: [main] + # Also on pull requests. Without this the Go stdlib CVE that broke the + # clean-security-scan claim sat undetected until it was already on main, + # because this workflow only ran on push, weekly, and manually. The scan is + # cheap and catches that class before merge instead of after. + pull_request: schedule: - cron: '20 6 * * 1' # weekly, Monday — catches newly-disclosed CVEs even with no code changes workflow_dispatch: @@ -17,6 +22,11 @@ permissions: read-all jobs: scorecard: name: OpenSSF Scorecard + # Scorecard refuses any ref but the default branch ("Only the default branch + # main is supported"), so running it on a PR or a workflow_dispatch against a + # feature branch produced a red run that meant nothing and buried the real + # result from the claims guard. Schedule and push-to-main still cover it. + if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest permissions: security-events: write