Skip to content

Commit a401fab

Browse files
authored
ci: restore CodeQL workflow with pull_request trigger (#7058)
## Summary - Restores `.github/workflows/codeql.yml` (removed in #5865) with the fix that it now runs on `pull_request` as well as `push` — closing the original concern from #5864. - Uses `go build ./...` instead of `make build` so the scan does not compile the multiplexer or embed legacy v3-v8 binaries. ## Why GitHub Code Scanning currently shows a CodeQL configuration error on this repo. The last analysis on `main` (2025-09-30) is an empty `default-setup` artifact (`rules_count: 0`, `tool_version: null`) left over after #5865 removed the workflow. Restoring a real workflow produces a valid analysis that supersedes the stale one. The stale record itself will be cleaned up via the Code Scanning API as a follow-up step after this PR merges. ## Test plan - [ ] CodeQL job runs to completion on this PR - [ ] Once merged, CodeQL runs on the merge commit to `main` - [ ] The Code Scanning page at https://github.com/celestiaorg/celestia-app/security/code-scanning no longer shows a configuration error for CodeQL Closes #5864 Closes PROTOCO-1489
1 parent fea99c6 commit a401fab

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# CodeQL security analysis.
2+
#
3+
# This workflow addresses celestiaorg/celestia-app#5864 (the prior workflow did
4+
# not run on PRs). It runs on:
5+
# - pull_request to main -> catches regressions before merge
6+
# - push to main and v* branches -> records results against protected refs
7+
# - weekly schedule -> picks up new CodeQL rule releases
8+
#
9+
# Pinned to commit SHAs per repo convention. Version comments indicate the
10+
# human-readable tag each SHA corresponds to.
11+
name: "CodeQL"
12+
13+
on:
14+
push:
15+
branches: ["main", "v*"]
16+
pull_request:
17+
branches: ["main"]
18+
schedule:
19+
- cron: "24 20 * * 4"
20+
21+
permissions:
22+
actions: read
23+
contents: read
24+
security-events: write
25+
26+
jobs:
27+
analyze:
28+
name: Analyze (${{ matrix.language }})
29+
runs-on: ubuntu-latest
30+
timeout-minutes: 60
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: ["go"]
36+
37+
steps:
38+
- name: Checkout repository
39+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
40+
41+
- name: Set up Go
42+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
43+
with:
44+
go-version-file: "go.mod"
45+
46+
- name: Initialize CodeQL
47+
uses: github/codeql-action/init@5c8a8a642e79153f5d047b10ec1cba1d1cc65699 # v3.35.1
48+
with:
49+
languages: ${{ matrix.language }}
50+
51+
# Build the module explicitly instead of `make build`. `make build` runs
52+
# the multiplexer and embeds legacy v3-v8 binaries, which is too slow for
53+
# a security scan and unnecessary for CodeQL's Go extractor.
54+
- name: Build Go packages
55+
run: go build ./...
56+
57+
- name: Perform CodeQL Analysis
58+
uses: github/codeql-action/analyze@5c8a8a642e79153f5d047b10ec1cba1d1cc65699 # v3.35.1
59+
with:
60+
category: "/language:${{ matrix.language }}"

0 commit comments

Comments
 (0)