-
Notifications
You must be signed in to change notification settings - Fork 2.5k
63 lines (54 loc) · 2.3 KB
/
Copy pathcodeql-analysis.yml
File metadata and controls
63 lines (54 loc) · 2.3 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
name: 'CodeQL: Code Scanning'
# Scheduled workflows only ever run from the default branch, so every code line
# that needs scanning is checked out explicitly by the matrix below and its
# results are attributed back to its own ref.
on:
schedule:
# Runs at 14:43 UTC on Sun.
- cron: '43 14 * * 0'
workflow_dispatch:
permissions:
contents: read
jobs:
analyze:
name: Analyze (${{ matrix.ref }})
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
ref: ['main', 'v7']
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support
language: ['javascript']
steps:
- name: Checkout ${{ matrix.ref }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ matrix.ref }}
persist-credentials: false
- name: Resolve analysed commit
id: commit
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@5595ccaf912efad79be6eef63a5619ff05969be3 # v4
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@5595ccaf912efad79be6eef63a5619ff05969be3 # v4
with:
# `ref`/`sha` file the alerts against the branch that was analysed
# rather than the branch the schedule fired from; `category` keeps the
# two branches' result sets from overwriting one another.
ref: refs/heads/${{ matrix.ref }}
sha: ${{ steps.commit.outputs.sha }}
category: /language:${{ matrix.language }}/ref:${{ matrix.ref }}