Skip to content

Commit 0404e2e

Browse files
committed
ci: add one-shot CodeQL verification
1 parent 2f14972 commit 0404e2e

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CodeQL verify once
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
paths:
7+
- ".github/triggers/codeql-verify"
8+
9+
permissions:
10+
contents: read
11+
security-events: read
12+
13+
jobs:
14+
verify:
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 5
17+
steps:
18+
- name: Verify no open CodeQL alerts remain
19+
env:
20+
GH_TOKEN: ${{ github.token }}
21+
shell: bash
22+
run: |
23+
set -euo pipefail
24+
open="$(gh api --paginate -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2026-03-10" "repos/${GITHUB_REPOSITORY}/code-scanning/alerts?state=open&per_page=100" --jq '.[] | .number' | wc -l | tr -d ' ')"
25+
echo "open_codeql_alerts=$open"
26+
test "$open" = "0"

0 commit comments

Comments
 (0)