ci: scan main on push so code-scanning baseline stays current#275
Merged
Conversation
The zizmor job was gated `if: github.event_name != 'push'`, so it never ran on push to main — the one event that refreshes the default-branch code-scanning baseline. As a result the baseline froze (last analysis 2025-07-17) with 9 stale alerts on a since-deleted workflow file, and the `code_scanning` branch rule treats those phantom alerts as a merge blocker on every PR. Run zizmor on push to main (and keep it on pull_request); skip only merge_group, where the PR scan already ran. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Code Coverage OverviewLanguages: Go, C# Go / code-coverage/testThe overall coverage remains at 50%, unchanged from the branch. C# / code-coverage/dotnetThe overall coverage remains at 100%, unchanged from the branch. Updated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every open PR on this repo is stuck at
mergeStateStatus: BLOCKED— including the promoted #271 (feat(create-issues-from-todos): support client-id), whose requiredCI - Required Checksis green and whose review threads are resolved.Root cause, verified live:
main's code-scanning baseline is frozen at 2025-07-17 (last zizmor analysis = commitb03c107,results_count: 9)..github/workflows/reusable-workflow-ci-gitops-test.yaml— a file that no longer exists onmain(1×zizmor/excessive-permissions, 8×zizmor/template-injection). They are phantom: the code that produced them was deleted months ago.mainbranch has acode_scanningprotection rule, so those 9 stale alerts are counted as a merge blocker on every PR, even when each PR's own required checks pass.Why the baseline never refreshes:
The
zizmorjob (which holdssecurity-events: writeand uploads SARIF) was gated off forpushevents. But push-to-mainis exactly the event that updates the default-branch code-scanning baseline. With it excluded, the baseline can never refresh and resolved findings can never auto-close — so the 2025-07-17 snapshot lingers indefinitely.Fix
Swap the excluded event: run zizmor on
pull_request(catch new findings) and onpushtomain(refresh the baseline so resolved findings auto-close), skipping onlymerge_group(the PR scan already ran; the queue ref makes a SARIF upload moot). One-line change to the job'sif:plus a comment explaining why.Once this is on
main, the next push triggers a fresh zizmor analysis. Current code has 0 zizmor findings (the PR-event zizmor job passes), so the new baseline closes the 9 phantom alerts and thecode_scanningblocker clears for all PRs.This PR is itself
BLOCKEDby the same stale baseline, so it can't merge until the deadlock is broken once. Either:reusable-workflow-ci-gitops-test.yaml; they're on a deleted file). That immediately unblocks this PR, feat(create-issues-from-todos): support client-id, deprecate app-id #271, and every other open actions PR. Then merging this PR keeps the baseline fresh going forward so it can't recur; orOption 1 is preferred — it unblocks the whole lane right away, and this PR then prevents recurrence.
Validation
actionlint .github/workflows/ci.yaml— clean for this change (the only output is two pre-existingcode-qualitypermission-scope warnings on unrelated lines 326/740, a known actionlint-version lag on that newer scope).mainbaseline refresh.Notes
github-appfinding on the token steps; the live code-scanning alerts show the real cause is the stale baseline above. Issue security: scope create-github-app-token tokens to least-privilege (zizmor github-app) #274 (least-privilege scoping of app-token steps) remains valid separate hardening but is not what blocks feat(create-issues-from-todos): support client-id, deprecate app-id #271.