fix(security): scan the default branch on push to keep CodeQL current - #280
Merged
parthrohit22 merged 1 commit intoAug 8, 2026
Conversation
The Code scanning page reported warnings detected in 2 configurations for both language:javascript-typescript and language:python. Neither was a finding: there are zero open code scanning alerts. Both configurations were simply stale, last analysed at 04d8e2b on 3 August, 37 commits behind dev. CodeQL only ran on pull_request and the weekly cron. A pull_request run analyses refs/pull/N/merge, which never updates the branch's own result, so dev's analysis could only refresh once a week and drifted between crons. Add a push trigger for dev and main so the default branch is re-analysed as work lands. Exempt default-branch runs from cancel-in-progress: that result is what the Security tab reports, and cancelling it during a run of merges would leave it stale again. PR and push runs use distinct refs, so they never cancel each other. Also corrects the schedule comment, which still claimed the weekly scan analysed stale main because dev was not yet the default branch. dev is the default branch now.
This was referenced Aug 8, 2026
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.
Summary
The Code scanning page reports "Warnings detected in 2 configurations" for both
language:javascript-typescriptandlanguage:python.Neither is a finding. There are zero open code scanning alerts:
Both configurations were simply stale. The last analysis of
devitself was commit04d8e2b2on 3 August — 5 days and 37 commits behind the branch head.Root cause: CodeQL only triggered on
pull_requestand the weekly cron. Apull_requestrun analysesrefs/pull/N/merge, a throwaway merge ref — it never updates the branch's own stored result. Sodev's analysis could only refresh once a week and drifted in between. Confirmed by trigger history:Every scan on
refs/heads/devis a cron run, exactly 7 days apart.Linked issue
None — found while reviewing the Security tab.
What changed
Infra —
.github/workflows/codeql.ymlpushtrigger fordevandmainso the default branch is re-analysed as work lands.cancel-in-progress. That result is what the Security tab reports, and cancelling it mid-way through a run of merges would leave the tab stale again — the exact problem this PR fixes. PR runs still cancel, sincerefs/pull/N/mergeandrefs/heads/devare distinct concurrency keys and never collide.main" becausedevwas not yet the default.devis the default branch now, so that note was actively misleading.No application code, contracts, or schemas changed.
Acceptance criteria completed
Testing performed
Workflow parsed and asserted against its intent (note
on:parses as booleanTrueunder YAML 1.1, which the check handles):The matrix is asserted to still cover exactly the two languages the Security tab lists, and
security-events: writeis asserted present since without it the analysis cannot upload results.Honest limit: a workflow trigger can only be proven by GitHub executing it. The definitive evidence is a
push-event CodeQL run appearing onrefs/heads/devonce this merges, refreshing both configurations to the new head SHA. I cannot produce that locally and am not claiming it.Screenshots
Not applicable — no UI change.
Security and data considerations
Improves security posture: the Security tab currently reflects code from 37 commits ago, so a vulnerability introduced since then would not appear until the next Monday cron. This closes that window to a single push.
permissionsare unchanged and remain least-privilege (security-events: writeonly on the analyze job,contents: readat workflow level). No secrets, egress, auth, or owner-scoping changes. Scan frequency rises from weekly to per-merge on the default branch, which is well within GitHub's included CodeQL allowance for this repository.Dependencies and blocked work
None.
Scope changes or remaining work
None.
Contributor checklist
dev.env,dist/, or generated artifacts committed