Skip to content

Commit 72f581f

Browse files
cameriCopilot
andauthored
ci: add CodeQL workflow (#558)
* ci: add CodeQL workflow * fix: correct YAML issues in CodeQL workflow (#580) Agent-Logs-Url: https://github.com/cameri/nostream/sessions/db5ea1d7-794d-41b1-bd2a-2c2d59800915 Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: cameri <378886+cameri@users.noreply.github.com> Co-authored-by: Ricardo Cabral <me@ricardocabral.io> --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: cameri <378886+cameri@users.noreply.github.com>
1 parent f1c1118 commit 72f581f

1 file changed

Lines changed: 121 additions & 0 deletions

File tree

.github/workflows/codeql.yml

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

0 commit comments

Comments
 (0)