Skip to content

Commit f04e038

Browse files
authored
chore: update the CodeQL workflow (TheAlgorithms#2449)
1 parent fddbf08 commit f04e038

File tree

1 file changed

+50
-40
lines changed

1 file changed

+50
-40
lines changed

.github/workflows/codeql.yml

Lines changed: 50 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,61 @@
1-
name: "CodeQL"
1+
name: "Code Scanning - Action"
22

33
on:
44
push:
5-
branches: [ "master" ]
5+
branches: [master]
66
pull_request:
7-
branches: [ "master" ]
7+
branches: [master]
8+
schedule:
9+
# ┌───────────── minute (0 - 59)
10+
# │ ┌───────────── hour (0 - 23)
11+
# │ │ ┌───────────── day of the month (1 - 31)
12+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
13+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
14+
# │ │ │ │ │
15+
# │ │ │ │ │
16+
# │ │ │ │ │
17+
# * * * * *
18+
- cron: '30 1 * * 0'
819

920
jobs:
10-
analyze:
11-
name: Analyze
21+
CodeQL-Build:
22+
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
1223
runs-on: ubuntu-latest
24+
1325
permissions:
26+
# required for all workflows
27+
security-events: write
28+
29+
# only required for workflows in private repositories
1430
actions: read
1531
contents: read
16-
security-events: write
32+
1733
steps:
18-
- name: Checkout repository
19-
uses: actions/checkout@v3
20-
- name: Initialize CodeQL
21-
uses: github/codeql-action/init@v2
22-
with:
23-
languages: cpp
24-
# If you wish to specify custom queries, you can do so here or in a config file.
25-
# By default, queries listed here will override any specified in a config file.
26-
# Prefix the list here with "+" to use these queries and those in the config file.
27-
28-
# 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
29-
# queries: security-extended,security-and-quality
30-
31-
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
32-
# If this step fails, then you should remove it and run the build manually (see below)
33-
- name: Autobuild
34-
uses: github/codeql-action/autobuild@v2
35-
36-
# ℹ️ Command-line programs to run using the OS shell.
37-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
38-
39-
# If the Autobuild fails above, remove it and uncomment the following three lines.
40-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
41-
42-
# - run: |
43-
# echo "Run, Build Application using script"
44-
# ./location_of_script_within_repo/buildscript.sh
45-
#
46-
# In our case, this would be a CMake build step.
47-
48-
- name: Perform CodeQL Analysis
49-
uses: github/codeql-action/analyze@v2
50-
with:
51-
category: "/language:cpp"
34+
- name: Checkout repository
35+
uses: actions/checkout@v3
36+
37+
# Initializes the CodeQL tools for scanning.
38+
- name: Initialize CodeQL
39+
uses: github/codeql-action/init@v2
40+
# Override language selection by uncommenting this and choosing your languages
41+
with:
42+
languages: cpp
43+
44+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
45+
# If this step fails, then you should remove it and run the build manually (see below).
46+
- name: Autobuild
47+
uses: github/codeql-action/autobuild@v2
48+
49+
# ℹ️ Command-line programs to run using the OS shell.
50+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
51+
52+
# ✏️ If the Autobuild fails above, remove it and uncomment the following
53+
# three lines and modify them (or add more) to build your code if your
54+
# project uses a compiled language
55+
56+
#- run: |
57+
# make bootstrap
58+
# make release
59+
60+
- name: Perform CodeQL Analysis
61+
uses: github/codeql-action/analyze@v2

0 commit comments

Comments
 (0)