Skip to content

Commit 5e92fd9

Browse files
committed
Adding initial CodeQL workflow
1 parent dfb9071 commit 5e92fd9

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: "CodeQL Scan"
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
analyze:
11+
name: Analyze Java
12+
runs-on: [codeql]
13+
permissions:
14+
# required for all workflows
15+
security-events: write
16+
17+
# required to fetch internal or private CodeQL packs
18+
packages: read
19+
20+
# only required for workflows in private repositories
21+
actions: read
22+
contents: read
23+
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
include:
28+
- language: actions
29+
build-mode: none
30+
- language: java-kotlin
31+
build-mode: autobuild
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
36+
- name: Initialize CodeQL
37+
uses: github/codeql-action/init@v3
38+
with:
39+
languages: ${{ matrix.language }}
40+
build-mode: ${{ matrix.build-mode }}
41+
# If you wish to specify custom queries, you can do so here or in a config file.
42+
# By default, queries listed here will override any specified in a config file.
43+
# Prefix the list here with "+" to use these queries and those in the config file.
44+
45+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
46+
# queries: security-extended,security-and-quality
47+
48+
# If the analyze step fails for one of the languages you are analyzing with
49+
# "We were unable to automatically build your code", modify the matrix above
50+
# to set the build mode to "manual" for that language. Then modify this step
51+
# to build your code.
52+
# ℹ️ Command-line programs to run using the OS shell.
53+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
54+
- if: matrix.build-mode == 'manual'
55+
shell: bash
56+
run: |
57+
echo 'If you are using a "manual" build mode for one or more of the' \
58+
'languages you are analyzing, replace this with the commands to build' \
59+
'your code, for example:'
60+
echo ' make bootstrap'
61+
echo ' make release'
62+
exit 1
63+
64+
- name: Perform CodeQL Analysis
65+
uses: github/codeql-action/analyze@v3
66+
with:
67+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)