-
Notifications
You must be signed in to change notification settings - Fork 2.4k
83 lines (68 loc) · 2.33 KB
/
codeql.yml
File metadata and controls
83 lines (68 loc) · 2.33 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
name: "CodeQL"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '0 0 * * 0'
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
# only required for workflows in private repositories
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: javascript-typescript
build-mode: none
steps:
- name: Clean up disk space
run: |
echo "Disk space before cleanup:"
df -h
echo ""
echo "Cleaning up unnecessary files to free disk space..."
# Remove large tool directories that aren't needed for JavaScript/TypeScript CodeQL analysis
# These tools will be re-downloaded by GitHub Actions if needed for other jobs
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/az
# Remove large tool caches (CodeQL will re-download only what it needs)
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
# Clean up system caches
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
# Remove Docker images if Docker is installed (not needed for CodeQL)
docker system prune -af || true
# Remove pip cache
rm -rf ~/.cache/pip || true
# Remove npm cache (will be recreated during checkout if needed)
npm cache clean --force || true
echo ""
echo "Disk space after cleanup:"
df -h
- name: Checkout repository
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# Use our custom config file to exclude unnecessary files
config-file: ./.github/codeql/codeql-config.yml
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{matrix.language}}"