-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 1.78 KB
/
Copy pathcodeql.yml
File metadata and controls
59 lines (50 loc) · 1.78 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
# CodeQL security analysis.
#
# If this job fails with "Code scanning is not enabled for this repository":
# GitHub → Settings → Code security and analysis → enable "Code scanning" (CodeQL).
# Public repos: free. Private repos: require GitHub Advanced Security (org/license).
#
# Until enabled, the analyze step uses continue-on-error so CI stays green; SARIF upload is skipped.
name: CodeQL
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
schedule:
- cron: "0 6 * * 1"
workflow_dispatch:
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
analyze:
name: Analyze JavaScript
runs-on: ubuntu-latest
timeout-minutes: 30
# Fork PRs cannot upload code scanning results to the base repository.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: javascript-typescript
queries: security-and-quality
- name: Autobuild
uses: github/codeql-action/autobuild@v4
- name: Perform CodeQL Analysis
id: analyze
uses: github/codeql-action/analyze@v4
continue-on-error: true
- name: Code scanning setup reminder
if: steps.analyze.outcome == 'failure'
run: |
echo "::warning::CodeQL analysis did not upload results. Enable Code scanning for this repository:"
echo " https://github.com/${{ github.repository }}/settings/security_analysis"
echo "See .github/workflows/codeql.yml and SECURITY.md for details."
exit 0