Skip to content

Commit 1d573b5

Browse files
Create codeql.yml
First version, provided by z-strom
1 parent 1b741e0 commit 1d573b5

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ "master" ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ "master" ]
20+
schedule:
21+
- cron: '28 3 * * 1'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
# Runner size impacts CodeQL analysis time. To learn more, please see:
27+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
28+
# - https://gh.io/supported-runners-and-hardware-resources
29+
# - https://gh.io/using-larger-runners
30+
# Consider using larger runners for possible analysis time improvements.
31+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
32+
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
33+
permissions:
34+
actions: read
35+
contents: read
36+
security-events: write
37+
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
language: [ 'java-kotlin' ]
42+
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
43+
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
44+
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
45+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
46+
47+
steps:
48+
- name: Checkout repository
49+
uses: actions/checkout@v3
50+
51+
- name: set up jdk 17
52+
uses: actions/setup-java@v3
53+
with:
54+
distribution: 'temurin'
55+
java-version: '17'
56+
57+
- name: checkout code
58+
uses: actions/checkout@v3
59+
60+
# Initializes the CodeQL tools for scanning.
61+
- name: Initialize CodeQL
62+
uses: github/codeql-action/init@v2
63+
with:
64+
languages: ${{ matrix.language }}
65+
# If you wish to specify custom queries, you can do so here or in a config file.
66+
# By default, queries listed here will override any specified in a config file.
67+
# Prefix the list here with "+" to use these queries and those in the config file.
68+
69+
# 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
70+
# queries: security-extended,security-and-quality
71+
72+
73+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
74+
# If this step fails, then you should remove it and run the build manually (see below)
75+
76+
# ℹ️ Command-line programs to run using the OS shell.
77+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
78+
79+
# If the Autobuild fails above, remove it and uncomment the following three lines.
80+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
81+
82+
- run: |
83+
mvn clean package -DskipTests
84+
85+
- name: Perform CodeQL Analysis
86+
uses: github/codeql-action/analyze@v2
87+
with:
88+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)