Skip to content

Commit ec9a762

Browse files
Add CodeQL configuration
1 parent abd0e5f commit ec9a762

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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-6 * * *'
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+
matrix:
32+
language: ["go","javascript","typescript"]
33+
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
34+
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
35+
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
36+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
37+
38+
steps:
39+
- name: Checkout repository
40+
uses: actions/checkout@v3
41+
42+
# Initializes the CodeQL tools for scanning.
43+
- name: Initialize CodeQL
44+
uses: github/codeql-action/init@v2
45+
with:
46+
languages: ${{ matrix.language }}
47+
# If you wish to specify custom queries, you can do so here or in a config file.
48+
# By default, queries listed here will override any specified in a config file.
49+
# Prefix the list here with "+" to use these queries and those in the config file.
50+
51+
# 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
52+
# queries: security-extended,security-and-quality
53+
54+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
55+
# If this step fails, then you should remove it and run the build manually (see below)
56+
- name: Autobuild
57+
uses: github/codeql-action/autobuild@v3
58+
59+
# Command-line programs to run using the OS shell.
60+
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
61+
62+
# If the Autobuild fails above, remove it and uncomment the following three lines.
63+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
64+
65+
# - run: |
66+
# echo "Run, Build Application using script"
67+
# ./location_of_script_within_repo/buildscript.sh
68+
69+
- name: Perform CodeQL Analysis
70+
uses: github/codeql-action/analyze@v3
71+
with:
72+
category: "/language:${{ matrix.language }}"

0 commit comments

Comments
 (0)