Skip to content

Commit a2f37e8

Browse files
sir-gonGonzalo Diaz
authored and
Gonzalo Diaz
committed
Create codeql.yml
1 parent 35462fe commit a2f37e8

File tree

1 file changed

+107
-0
lines changed

1 file changed

+107
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
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+
---
13+
name: "CodeQL"
14+
15+
on: # yamllint disable-line rule:truthy
16+
push:
17+
pull_request:
18+
workflow_dispatch:
19+
schedule:
20+
# ┌───────────── minute (0 - 59)
21+
# │ ┌───────────── hour (0 - 23)
22+
# │ │ ┌───────────── day of the month (1 - 31)
23+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
24+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
25+
# │ │ │ │ │
26+
# │ │ │ │ │
27+
# │ │ │ │ │
28+
# * * * * *
29+
- cron: '24 19 * * 3'
30+
31+
jobs:
32+
analyze:
33+
name: Analyze (${{ matrix.language }})
34+
# Runner size impacts CodeQL analysis time. To learn more, please see:
35+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
36+
# - https://gh.io/supported-runners-and-hardware-resources
37+
# - https://gh.io/using-larger-runners (GitHub.com only)
38+
# Consider using larger runners or machines with greater resources
39+
# for possible analysis time improvements.
40+
runs-on:
41+
${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
42+
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
43+
permissions:
44+
# required for all workflows
45+
security-events: write
46+
47+
# required to fetch internal or private CodeQL packs
48+
packages: read
49+
50+
# only required for workflows in private repositories
51+
actions: read
52+
contents: read
53+
54+
strategy:
55+
fail-fast: false
56+
matrix:
57+
include:
58+
- language: csharp
59+
build-mode: none
60+
# yamllint disable rule:line-length
61+
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
62+
# Use `c-cpp` to analyze code written in C, C++ or both
63+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
64+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
65+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
66+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
67+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
68+
# 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
69+
# yamllint enable rule:line-length
70+
steps:
71+
- name: Checkout repository
72+
uses: actions/checkout@v4
73+
74+
# Initializes the CodeQL tools for scanning.
75+
- name: Initialize CodeQL
76+
uses: github/codeql-action/init@v3
77+
with:
78+
languages: ${{ matrix.language }}
79+
build-mode: ${{ matrix.build-mode }}
80+
# yamllint disable rule:line-length
81+
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+
# yamllint enable rule:line-length
89+
90+
# yamllint disable rule:line-length
91+
# If the analyze step fails for one of the languages you are analyzing with
92+
# "We were unable to automatically build your code", modify the matrix above
93+
# to set the build mode to "manual" for that language. Then modify this step
94+
# to build your code.
95+
# ℹ️ Command-line programs to run using the OS shell.
96+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
97+
# yamllint enable rule:line-length
98+
- if: matrix.build-mode == 'manual'
99+
shell: bash
100+
run: |
101+
echo 'If you are using a "manual" build mode for one or more of the' \
102+
dotnet build
103+
104+
- name: Perform CodeQL Analysis
105+
uses: github/codeql-action/analyze@v3
106+
with:
107+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)