Skip to content

Commit b87be3c

Browse files
authored
Create codeql.yml (#1006)
* Create codeql.yml Replacement for LGTM * Only scan src directory. Use ./configure --buildlibs to build. * paths doesnt seem to have been specified correctly * Fix space error * More space issues? * Exclude subdirs that contain external code
1 parent 5e5641a commit b87be3c

File tree

1 file changed

+83
-0
lines changed

1 file changed

+83
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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"
13+
14+
on:
15+
push:
16+
branches: [ "master" ]
17+
paths:
18+
- 'src/**'
19+
- '!src/tng/**'
20+
- '!src/readline/**'
21+
pull_request:
22+
# The branches below must be a subset of the branches above
23+
branches: [ "master" ]
24+
paths:
25+
- 'src/**'
26+
- '!src/tng/**'
27+
- '!src/readline/**'
28+
schedule:
29+
- cron: '26 13 * * 3'
30+
31+
jobs:
32+
analyze:
33+
name: Analyze
34+
runs-on: ubuntu-latest
35+
permissions:
36+
actions: read
37+
contents: read
38+
security-events: write
39+
40+
strategy:
41+
fail-fast: false
42+
matrix:
43+
language: [ 'cpp' ]
44+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
45+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
46+
47+
steps:
48+
- name: Checkout repository
49+
uses: actions/checkout@v3
50+
51+
# Initializes the CodeQL tools for scanning.
52+
- name: Initialize CodeQL
53+
uses: github/codeql-action/init@v2
54+
with:
55+
languages: ${{ matrix.language }}
56+
# If you wish to specify custom queries, you can do so here or in a config file.
57+
# By default, queries listed here will override any specified in a config file.
58+
# Prefix the list here with "+" to use these queries and those in the config file.
59+
60+
# 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
61+
# queries: security-extended,security-and-quality
62+
63+
64+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
65+
# If this step fails, then you should remove it and run the build manually (see below)
66+
#- name: Autobuild
67+
# uses: github/codeql-action/autobuild@v2
68+
69+
# ℹ️ Command-line programs to run using the OS shell.
70+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
71+
72+
# If the Autobuild fails above, remove it and uncomment the following three lines.
73+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
74+
75+
- run: |
76+
./configure --buildlibs gnu
77+
make install
78+
# ./location_of_script_within_repo/buildscript.sh
79+
80+
- name: Perform CodeQL Analysis
81+
uses: github/codeql-action/analyze@v2
82+
with:
83+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)