Skip to content

Commit fe7e726

Browse files
authored
Add CodeQL analysis to GitHub workflow (#66)
1 parent a4b9284 commit fe7e726

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
jobs:
1212
ci-build:
1313
strategy:
14+
fail-fast: false
1415
matrix:
1516
go-version: [1.15]
1617
os: [ubuntu-latest, macos-latest, windows-latest]
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
# The branches below must be a subset of the branches above
8+
branches: [ master ]
9+
schedule:
10+
- cron: '11 0 * * 5'
11+
12+
jobs:
13+
analyze:
14+
name: Analyze
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
language: [ 'go' ]
21+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
22+
# Learn more:
23+
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v2
28+
29+
# Initializes the CodeQL tools for scanning.
30+
- name: Initialize CodeQL
31+
uses: github/codeql-action/init@v1
32+
with:
33+
languages: ${{ matrix.language }}
34+
# If you wish to specify custom queries, you can do so here or in a config file.
35+
# By default, queries listed here will override any specified in a config file.
36+
# Prefix the list here with "+" to use these queries and those in the config file.
37+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
38+
39+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
40+
# If this step fails, then you should remove it and run the build manually (see below)
41+
- name: Autobuild
42+
uses: github/codeql-action/autobuild@v1
43+
44+
# ℹ️ Command-line programs to run using the OS shell.
45+
# 📚 https://git.io/JvXDl
46+
47+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
48+
# and modify them (or add more) to build your code if your project
49+
# uses a compiled language
50+
51+
#- run: |
52+
# make bootstrap
53+
# make release
54+
55+
- name: Perform CodeQL Analysis
56+
uses: github/codeql-action/analyze@v1

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ It includes:
2222
- unit testing with [testify](https://github.com/stretchr/testify), [race detector](https://blog.golang.org/race-detector), code covarage [HTML report](https://blog.golang.org/cover) and [Codecov report](https://codecov.io/),
2323
- releasing using [GoReleaser](https://github.com/goreleaser/goreleaser),
2424
- dependencies scanning and updating thanks to [Dependabot](https://dependabot.com),
25+
- security code analysis using [CodeQL Action](https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/about-code-scanning),
2526
- [Visual Studio Code](https://code.visualstudio.com) configuration with [Go](https://code.visualstudio.com/docs/languages/go) and [Remote Container](https://code.visualstudio.com/docs/remote/containers) support.
2627

2728
`Star` this repository if you find it valuable and worth maintaining.

0 commit comments

Comments
 (0)