-
Notifications
You must be signed in to change notification settings - Fork 3k
92 lines (83 loc) · 2.99 KB
/
Copy pathcodeql.yml
File metadata and controls
92 lines (83 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: CodeQL
# Security vulnerability scanning for QwenPaw.
#
# Phase 1 (current): dry-run mode — discoveries are reported as alerts
# in the Security tab and as PR comments, but do NOT block merge.
# Phase 2 (week 2): clean up findings, configure false-positive
# suppression.
# Phase 3 (week 3): remove continue-on-error to make CodeQL a required
# check (maintainer must add it to branch protection).
#
# Two shards, one per language — each scans its own file set, so findings
# are deduplicated across languages and no CI time is wasted on
# re-scanning the same files:
# python → all Python (src/qwenpaw/** + scripts/**), minus the
# test/repro exclusions in codeql-config.yml
# typescript → console/src/** (React/Vite frontend)
# Tests are intentionally excluded (see codeql-config.yml paths-ignore):
# they contain intentionally "unsafe" patterns that are not real
# vulnerabilities.
on:
pull_request:
branches: [main, master, dev, develop]
paths:
- 'src/**'
- 'console/src/**'
- 'scripts/**'
- 'tests/**'
- '.github/workflows/codeql.yml'
- '.github/codeql-config.yml'
push:
branches: [main]
schedule:
# Weekly full scan: Monday 03:17 UTC (off-peak)
- cron: '17 3 * * 1'
permissions:
contents: read
security-events: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
analyze:
name: CodeQL (${{ matrix.shard }})
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- shard: python
languages: python
build-mode: none
- shard: typescript
languages: typescript
build-mode: none
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.languages }}
config-file: ./.github/codeql-config.yml
build-mode: ${{ matrix.build-mode }}
- name: Perform CodeQL Analysis
id: analyze
uses: github/codeql-action/analyze@v3
with:
category: ${{ matrix.shard }}
# Phase 1: dry-run — don't fail the workflow on findings.
# Phase 3: remove this line to enable blocking.
continue-on-error: true
- name: Upload CodeQL results summary
if: always()
run: |
echo "### CodeQL Scan: ${{ matrix.shard }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Status:** ${{ steps.analyze.outcome }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Language:** ${{ matrix.languages }}" >> $GITHUB_STEP_SUMMARY
echo "**Mode:** dry-run (non-blocking)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "View findings in the [Security tab](https://github.com/${{ github.repository }}/security/code-scanning)" >> $GITHUB_STEP_SUMMARY