Skip to content

Commit cbe98d7

Browse files
Add CodeQL configuration
1 parent a972a3f commit cbe98d7

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

.github/workflows/codeql.yml

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

0 commit comments

Comments
 (0)