Repository navigation
Commit b0e83f3
fix(ci): Fix CodeQL workflow to properly analyze Go code (jaegertracing#7885)
## Which problem is this PR solving?
This PR fixes two CodeQL security scanning issues visible at:
https://github.com/jaegertracing/jaeger/security/code-scanning/tools/CodeQL/status/configurations/actions-FZTWS5DIOVRC653POJVWM3DPO5ZS6Y3PMRSXC3BOPFWWY
### Issue 1: "Go files were found but not processed"
CodeQL's `Autobuild` step was unable to properly compile the Go
codebase, preventing security analysis.
### Issue 2: "Code Scanning results may be out of date"
The last successful scan was Feb 13, 2025. This was caused by PR jaegertracing#6719
which added:
```yaml
if: ${{ github.event_name == 'pull_request' }}
```
This condition was intended to prevent duplicate runs in merge queue,
but it also disabled scans for:
- Push events to `main`
- Scheduled weekly runs
## Description of the changes
### Fix for Autobuild failure
- Replace `Autobuild` with explicit `go build ./...` for Go (Autobuild
is kept for Python)
- Add `setup-go` action to ensure Go is properly configured
- Add `submodules: true` to checkout for complete codebase
### Fix for stale scan results
- Change condition from `== 'pull_request'` to `!= 'merge_group'`
- This preserves the merge queue optimization while enabling scans on
all other triggers
### Updated trigger behavior
| Event | CodeQL Runs? | Reason |
|-------|-------------|--------|
| `pull_request` | ✅ Yes | Primary scan when code is submitted |
| `push` to main | ✅ Yes | Catches direct commits & validates merged
code |
| `schedule` (weekly) | ✅ Yes | Catches new vulnerabilities in
dependencies |
| `merge_group` | ❌ Skipped | Already scanned on `pull_request` |
## How was this change tested?
- Manual review of workflow syntax
- Verification that the workflow triggers correctly based on GitHub
Actions documentation
## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have run lint and test steps successfully (N/A - workflow file
only)
## References
- Original issue: github/codeql-action#1537
- PR that introduced the restriction: jaegertracing#6719
Signed-off-by: Jonah Kowall <[email protected]>1 parent 1f304f1 commit b0e83f3
1 file changed
Lines changed: 26 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | | - | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
36 | | - | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | | - | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
46 | 55 | | |
47 | | - | |
48 | 56 | | |
49 | | - | |
| 57 | + | |
50 | 58 | | |
51 | 59 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | 60 | | |
57 | | - | |
58 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
59 | 72 | | |
60 | 73 | | |
61 | | - | |
| 74 | + | |
0 commit comments