Skip to content

Commit 62cac3a

Browse files
committed
Update CodeQL workflow.
1 parent c109630 commit 62cac3a

3 files changed

Lines changed: 41 additions & 47 deletions

File tree

.github/codeql.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
paths-ignore:
2+
- '**/test*.c'
3+
4+
queries:
5+
- exclude:
6+
id: cpp/integer-multiplication-cast-to-long
7+
- exclude:
8+
id: cpp/missing-header-guard
9+
- exclude:
10+
id: cpp/short-global-name
11+
- exclude:
12+
id: cpp/tainted-format-string
13+
- exclude:
14+
id: cpp/toctou-race-condition
Lines changed: 27 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
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.
61
name: "CodeQL"
72

83
on:
94
push:
105
branches: [master]
116
pull_request:
12-
# The branches below must be a subset of the branches above
137
branches: [master]
148
schedule:
159
- cron: '0 7 * * 6'
@@ -18,45 +12,37 @@ jobs:
1812
analyze:
1913
name: Analyze
2014
runs-on: ubuntu-latest
15+
permissions:
16+
actions: read
17+
contents: read
18+
security-events: write
2119

2220
strategy:
2321
fail-fast: false
2422
matrix:
25-
# Override automatic language detection by changing the below list
26-
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
2723
language: ['cpp']
28-
# Learn more...
29-
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
3024

3125
steps:
32-
- name: Checkout repository
33-
uses: actions/checkout@v2
34-
35-
# Initializes the CodeQL tools for scanning.
36-
- name: Initialize CodeQL
37-
uses: github/codeql-action/init@v1
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-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
44-
45-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
46-
# If this step fails, then you should remove it and run the build manually (see below)
47-
- name: Autobuild
48-
uses: github/codeql-action/autobuild@v1
49-
50-
# ℹ️ Command-line programs to run using the OS shell.
51-
# 📚 https://git.io/JvXDl
52-
53-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
54-
# and modify them (or add more) to build your code if your project
55-
# uses a compiled language
56-
57-
#- run: |
58-
# make bootstrap
59-
# make release
60-
61-
- name: Perform CodeQL Analysis
62-
uses: github/codeql-action/analyze@v1
26+
- name: Checkout repository
27+
uses: actions/checkout@v3
28+
29+
- name: Update build environment
30+
run: sudo apt-get update --fix-missing -y
31+
32+
- name: Install prerequisites
33+
run: sudo apt-get install -y avahi-daemon cppcheck libavahi-client-dev libssl-dev libusb-1.0-0-dev zlib1g-dev
34+
35+
- name: Initialize CodeQL
36+
uses: github/codeql-action/init@v2
37+
with:
38+
languages: ${{ matrix.language }}
39+
config-file: ./.github/codeql.yml
40+
queries: +security-and-quality
41+
42+
- name: Autobuild
43+
uses: github/codeql-action/autobuild@v2
44+
45+
- name: Perform CodeQL Analysis
46+
uses: github/codeql-action/analyze@v2
47+
with:
48+
category: "/language:${{ matrix.language }}"

.lgtm.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)