Skip to content

Commit d88fb02

Browse files
committed
ci: add CodeQL workflow
1 parent 5c1c827 commit d88fb02

File tree

1 file changed

+106
-0
lines changed

1 file changed

+106
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax
2+
name: CodeQL
3+
4+
on: # https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows
5+
push:
6+
branches: [ "master" ]
7+
paths-ignore:
8+
- '**/*.md'
9+
- '.github/*.yml'
10+
- '.github/workflows/build.yml'
11+
- '.github/workflows/licensecheck.yml'
12+
- '.github/workflows/updateTarget.yml'
13+
- '**/.project'
14+
- '**/.settings/*.prefs'
15+
- '.gitignore'
16+
- '.actrc'
17+
- 'Jenkinsfile'
18+
pull_request:
19+
branches: [ "master" ]
20+
paths-ignore:
21+
- '**/*.md'
22+
- '.github/*.yml'
23+
- '.github/workflows/build.yml'
24+
- '.github/workflows/licensecheck.yml'
25+
- '.github/workflows/updateTarget.yml'
26+
- '**/.project'
27+
- '**/.settings/*.prefs'
28+
- '.gitignore'
29+
- '.actrc'
30+
- 'Jenkinsfile'
31+
workflow_dispatch:
32+
# https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#workflow_dispatch
33+
34+
35+
jobs:
36+
37+
###########################################################
38+
analyze:
39+
###########################################################
40+
41+
strategy:
42+
fail-fast: false
43+
matrix:
44+
include:
45+
# build-mode: https://github.com/github/codeql-action#build-modes
46+
- language: java-kotlin
47+
build-mode: none
48+
- language: javascript-typescript
49+
build-mode: none
50+
- language: python
51+
build-mode: none
52+
53+
name: Analyze (${{ matrix.language }})
54+
runs-on: ubuntu-latest
55+
permissions:
56+
# required for all workflows
57+
security-events: write
58+
59+
# required to fetch internal or private CodeQL packs
60+
packages: read
61+
62+
# only required for workflows in private repositories
63+
actions: read
64+
contents: read
65+
66+
timeout-minutes: 15
67+
68+
steps:
69+
- name: "Show: GitHub context"
70+
env:
71+
GITHUB_CONTEXT: ${{ toJSON(github) }}
72+
run: echo $GITHUB_CONTEXT
73+
74+
75+
- name: "Show: environment variables"
76+
run: env | sort
77+
78+
79+
- name: Git Checkout
80+
uses: actions/checkout@v5 # https://github.com/actions/checkout
81+
82+
83+
# CodeQL executes https://github.com/ferstl/depgraph-maven-plugin
84+
- name: "Install: JDK 25 for Maven/Tycho ☕"
85+
uses: actions/setup-java@v5 # https://github.com/actions/setup-java
86+
if: ${{ matrix.language }} == 'java'
87+
with:
88+
distribution: temurin
89+
java-version: 25
90+
91+
92+
# https://docs.github.com/en/code-security/code-scanning
93+
- name: Initialize CodeQL
94+
uses: github/codeql-action/init@v4 # https://github.com/github/codeql-action
95+
with:
96+
languages: ${{ matrix.language }}
97+
# https://github.com/github/codeql-action#build-modes
98+
build-mode: ${{ matrix.build-mode }}
99+
# https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#using-queries-in-ql-packs
100+
queries: +security-and-quality
101+
102+
103+
- name: Perform CodeQL Analysis
104+
uses: github/codeql-action/analyze@v4 # https://github.com/github/codeql-action
105+
with:
106+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)