-
Notifications
You must be signed in to change notification settings - Fork 60
39 lines (27 loc) · 1.05 KB
/
codeql.yml
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
name: CodeQL workflow for analyzing QL queries
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
env:
NIXPKGS_ALLOW_UNFREE: 1
jobs:
analyze-ql-files:
name: Analyze QL files
runs-on: ubuntu-latest
steps:
- name: Install Nix
uses: cachix/install-nix-action@6004951b182f8860210c8d6f0d808ec5b1a33d28
- name: Checkout
uses: actions/checkout@v4
- name: Create database
run: |
nix-shell --pure --command "codeql database create --language=ql --source=. $RUNNER_TEMP/ql-db" tooling/shell.nix
- name: Analyze database
run: |
nix-shell --pure --command "codeql database analyze --output=$RUNNER_TEMP/ql.sarif --format=sarif-latest --sarif-category=ql4ql -- $RUNNER_TEMP/ql-db codeql/ql" tooling/shell.nix
- name: Upload results
run: |
nix-shell --pure --command "codeql github upload-results --sarif=$RUNNER_TEMP/ql.sarif --repository=$GITHUB_REPOSITORY --ref=$GITHUB_REF --commit=$GITHUB_SHA" tooling/shell.nix