Skip to content

Commit 0b7bc22

Browse files
committed
chore: add codeql workflow
1 parent 93a6bcb commit 0b7bc22

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: "CodeQL Advanced"
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
schedule:
9+
- cron: '21 1 * * 1'
10+
11+
jobs:
12+
analyze:
13+
name: Analyze (${{ matrix.language }})
14+
runs-on: 'ubuntu-latest'
15+
permissions:
16+
# required for all workflows
17+
security-events: write
18+
19+
# required to fetch internal or private CodeQL packs
20+
packages: read
21+
22+
# only required for workflows in private repositories
23+
actions: read
24+
contents: read
25+
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
include:
30+
- language: actions
31+
build-mode: none
32+
- language: java-kotlin
33+
build-mode: none # This mode only analyzes Java. Set this to 'autobuild' or 'manual' to analyze Kotlin too.
34+
- language: javascript-typescript
35+
build-mode: none
36+
steps:
37+
- name: Checkout repository
38+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
39+
with:
40+
persist-credentials: false
41+
42+
# Initializes the CodeQL tools for scanning.
43+
- name: Initialize CodeQL
44+
uses: github/codeql-action@38697555549f1db7851b81482ff19f1fa5c4fedc # v4
45+
with:
46+
languages: ${{ matrix.language }}
47+
build-mode: ${{ matrix.build-mode }}
48+
49+
# If the analyze step fails for one of the languages you are analyzing with
50+
# "We were unable to automatically build your code", modify the matrix above
51+
# to set the build mode to "manual" for that language. Then modify this step
52+
# to build your code.
53+
# ℹ️ Command-line programs to run using the OS shell.
54+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
55+
- name: Run manual build steps
56+
if: matrix.build-mode == 'manual'
57+
shell: bash
58+
run: |
59+
echo 'If you are using a "manual" build mode for one or more of the' \
60+
'languages you are analyzing, replace this with the commands to build' \
61+
'your code, for example:'
62+
echo ' make bootstrap'
63+
echo ' make release'
64+
exit 1
65+
66+
- name: Perform CodeQL Analysis
67+
uses: github/codeql-action@38697555549f1db7851b81482ff19f1fa5c4fedc # v4
68+
with:
69+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)