Repository navigation
65 lines (58 loc) · 2.29 KB
/
Copy pathcodeql.yml
File metadata and controls
65 lines (58 loc) · 2.29 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
name: CodeQL
on:
push:
branches: [main]
pull_request:
schedule:
# Weekly full sweep on Monday ~03:37 UTC, off the top of the hour to
# avoid GitHub's scheduled-run congestion.
- cron: '37 3 * * 1'
concurrency:
group: codeql-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
security-events: write
jobs:
analyze:
name: Analyze (javascript-typescript)
# Pinned instead of `ubuntu-latest`: that label migrates to Ubuntu 26.04
# between 2026-10-19 and 2026-11-19 (actions/runner-images#14748).
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
fetch-depth: 0
- name: Detect docs-only pull request
id: scope
if: github.event_name == 'pull_request'
env:
GITHUB_EVENT_NAME: ${{ github.event_name }}
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
CI_SCOPE_ROOT: ${{ github.workspace }}
run: |
# Pull request code is untrusted; execute the scope logic from base.
script="$RUNNER_TEMP/ci-scope.cjs"
if git cat-file blob "${PR_BASE_SHA}:scripts/ci-scope.cjs" >"$script" 2>/dev/null; then
node "$script"
else
echo "::warning::Trusted ci-scope script unavailable; running full CI"
echo "run=true" >> "$GITHUB_OUTPUT"
fi
- name: Initialize CodeQL
if: github.event_name != 'pull_request' || steps.scope.outputs.run == 'true'
uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
languages: javascript-typescript
config-file: ./.github/codeql/codeql-config.yml
- name: Perform CodeQL Analysis
if: github.event_name != 'pull_request' || steps.scope.outputs.run == 'true'
uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
category: '/language:javascript-typescript'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}