Skip to content

Commit 34133a6

Browse files
committed
Create codeql.yml
1 parent 3fc010d commit 34133a6

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

Diff for: .github/workflows/codeql.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
schedule:
11+
- cron: "30 15 * * 0" # run every Sunday at 15:30 UTC
12+
13+
jobs:
14+
analyze:
15+
permissions:
16+
security-events: write
17+
actions: read
18+
contents: read
19+
name: Analyze
20+
runs-on: ubuntu-22.04
21+
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
language: ["go"]
26+
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
27+
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
28+
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
29+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
30+
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
34+
35+
# Initializes the CodeQL tools for scanning.
36+
- name: Initialize CodeQL
37+
uses: github/codeql-action/init@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6
38+
with:
39+
languages: ${{ matrix.language }}
40+
# If you wish to specify custom queries, you can do so here or in a config file.
41+
# By default, queries listed here will override any specified in a config file.
42+
# Prefix the list here with "+" to use these queries and those in the config file.
43+
44+
# 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
45+
# queries: security-extended,security-and-quality
46+
47+
- name: Setup Golang Environment
48+
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
49+
with:
50+
go-version: stable
51+
if: matrix.language == 'go'
52+
53+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
54+
# If this step fails, then you should remove it and run the build manually (see below)
55+
- name: Autobuild
56+
uses: github/codeql-action/autobuild@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6
57+
58+
# ℹ️ Command-line programs to run using the OS shell.
59+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
60+
61+
# If the Autobuild fails above, remove it and uncomment the following three lines.
62+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
63+
64+
# - run: |
65+
# echo "Run, Build Application using script"
66+
# ./location_of_script_within_repo/buildscript.sh
67+
68+
- name: Perform CodeQL Analysis
69+
uses: github/codeql-action/analyze@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6
70+
with:
71+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)