Skip to content

Commit eb74e86

Browse files
authored
Add CodeQL workflow configuration file (#112)
1 parent 1f65299 commit eb74e86

File tree

2 files changed

+109
-0
lines changed

2 files changed

+109
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
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 Advanced"
13+
14+
on:
15+
push:
16+
branches: ["main"]
17+
paths:
18+
- src/**/*
19+
- .github/**/*
20+
pull_request:
21+
branches: ["main"]
22+
paths:
23+
- src/**/*
24+
- .github/**/*
25+
schedule:
26+
- cron: "35 13 * * 4"
27+
# Allows you to run this workflow manually from the Actions tab
28+
workflow_dispatch:
29+
30+
jobs:
31+
analyze:
32+
name: Analyze (${{ matrix.language }})
33+
# Runner size impacts CodeQL analysis time. To learn more, please see:
34+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
35+
# - https://gh.io/supported-runners-and-hardware-resources
36+
# - https://gh.io/using-larger-runners (GitHub.com only)
37+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
38+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
39+
permissions:
40+
# required for all workflows
41+
security-events: write
42+
43+
# required to fetch internal or private CodeQL packs
44+
packages: read
45+
46+
# only required for workflows in private repositories
47+
actions: read
48+
contents: read
49+
50+
strategy:
51+
fail-fast: false
52+
matrix:
53+
include:
54+
- language: actions
55+
build-mode: none
56+
- language: javascript-typescript
57+
build-mode: none
58+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
59+
# Use `c-cpp` to analyze code written in C, C++ or both
60+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
61+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
62+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
63+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
64+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
65+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
66+
steps:
67+
- name: Checkout repository
68+
uses: actions/checkout@v4
69+
70+
# Add any setup steps before running the `github/codeql-action/init` action.
71+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
72+
# or others). This is typically only required for manual builds.
73+
# - name: Setup runtime (example)
74+
# uses: actions/setup-example@v1
75+
76+
# Initializes the CodeQL tools for scanning.
77+
- name: Initialize CodeQL
78+
uses: github/codeql-action/init@v3
79+
with:
80+
languages: ${{ matrix.language }}
81+
build-mode: ${{ matrix.build-mode }}
82+
# If you wish to specify custom queries, you can do so here or in a config file.
83+
# By default, queries listed here will override any specified in a config file.
84+
# Prefix the list here with "+" to use these queries and those in the config file.
85+
86+
# 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
87+
# queries: security-extended,security-and-quality
88+
89+
# If the analyze step fails for one of the languages you are analyzing with
90+
# "We were unable to automatically build your code", modify the matrix above
91+
# to set the build mode to "manual" for that language. Then modify this step
92+
# to build your code.
93+
# ℹ️ Command-line programs to run using the OS shell.
94+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
95+
- if: matrix.build-mode == 'manual'
96+
shell: bash
97+
run: |
98+
echo 'If you are using a "manual" build mode for one or more of the' \
99+
'languages you are analyzing, replace this with the commands to build' \
100+
'your code, for example:'
101+
echo ' make bootstrap'
102+
echo ' make release'
103+
exit 1
104+
105+
- name: Perform CodeQL Analysis
106+
uses: github/codeql-action/analyze@v3
107+
with:
108+
category: "/language:${{matrix.language}}"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
/coverage/
33
/dist/
44
/node_modules/
5+
/lalla

0 commit comments

Comments
 (0)