-
Notifications
You must be signed in to change notification settings - Fork 51
78 lines (68 loc) · 2.21 KB
/
codeql.yml
File metadata and controls
78 lines (68 loc) · 2.21 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
name: "CodeQL Scan"
# zizmor ignore: This workflow does not generate artifacts, setup-go is used to execute CodeQL
on: # zizmor: ignore[cache-poisoning]
pull_request:
branches:
- main
- release**
push:
branches:
- main
- release**
schedule:
- cron: "37 3 * * 0"
permissions: {} # No permissions by default on workflow level
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
permissions:
security-events: write # required to publish sarif
strategy:
fail-fast: false
matrix:
include:
- language: actions
build-mode: none
- language: javascript-typescript
build-mode: none
- language: python
build-mode: none
- language: go
build-mode: autobuild
steps:
- name: Harden the runner (audit all outbound calls)
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
with:
egress-policy: audit
- name: Free space on runner (delete unnecessary tools)
shell: bash
run: |
echo "Free space before deletion:"
df -h /
rm -rf /opt/hostedtoolcache || true
if [ -f /swapfile ]; then
sudo swapoff -a
sudo rm -f /swapfile
fi
echo "Free space after deletion:"
df -h /
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup GO
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: "1.24"
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: security-extended
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
with:
category: "/language:${{matrix.language}}"