Skip to content

Commit 1568203

Browse files
committed
ci: add CodeQL advanced setup to scan pull requests before merge
1 parent 2826dcf commit 1568203

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CodeQL
2+
3+
# Advanced setup so CodeQL also runs on pull requests (including from forks),
4+
# surfacing findings before merge instead of only after a change lands on dev.
5+
on:
6+
push:
7+
branches: [dev, main]
8+
pull_request:
9+
branches: [dev]
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
analyze:
16+
name: Analyze (${{ matrix.language }})
17+
runs-on: ubuntu-latest
18+
permissions:
19+
security-events: write
20+
actions: read
21+
contents: read
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
language: [actions, javascript-typescript, python]
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
29+
with:
30+
persist-credentials: false
31+
- name: Initialize CodeQL
32+
uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
33+
with:
34+
languages: ${{ matrix.language }}
35+
build-mode: none
36+
- name: Perform CodeQL Analysis
37+
uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
38+
with:
39+
category: "/language:${{ matrix.language }}"

0 commit comments

Comments
 (0)