Skip to content

Commit 8452407

Browse files
author
Songki Choi
authored
Support CodeQL for security code scan (#14)
1 parent c16a344 commit 8452407

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/code_scan.yml

+53
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ on:
66
- cron: "0 19 * * 1-5"
77
push:
88
branches:
9+
- develop
910
- releases/*
1011
workflow_dispatch: # run on request (no need for PR)
12+
workflow_call: # run by other workflow
1113

1214
# Declare default permissions as read only.
1315
permissions: read-all
@@ -67,3 +69,54 @@ jobs:
6769
path: bandit-scan-results.txt
6870
# Use always() to always run this step to publish scan results when there are test failures
6971
if: ${{ always() }}
72+
73+
CodeQL-Scan:
74+
runs-on: ubuntu-22.04
75+
timeout-minutes: 60
76+
permissions:
77+
# required for all workflows
78+
security-events: write
79+
80+
# only required for workflows in private repositories
81+
actions: read
82+
contents: read
83+
84+
strategy:
85+
fail-fast: false
86+
matrix:
87+
language: ["python"]
88+
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
89+
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
90+
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
91+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
92+
93+
steps:
94+
- name: Checkout repository
95+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
96+
97+
# Initializes the CodeQL tools for scanning.
98+
- name: Initialize CodeQL
99+
uses: github/codeql-action/init@47b3d888fe66b639e431abf22ebca059152f1eea # v3.24.5
100+
with:
101+
languages: ${{ matrix.language }}
102+
# If you wish to specify custom queries, you can do so here or in a config file.
103+
# By default, queries listed here will override any specified in a config file.
104+
# Prefix the list here with "+" to use these queries and those in the config file.
105+
106+
# 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
107+
# queries: security-extended,security-and-quality
108+
109+
- name: Perform CodeQL Analysis
110+
uses: github/codeql-action/analyze@47b3d888fe66b639e431abf22ebca059152f1eea # v3.24.5
111+
with:
112+
category: "/language:${{matrix.language}}"
113+
- name: Generate Security Report
114+
uses: rsdmike/github-security-report-action@a149b24539044c92786ec39af8ba38c93496495d # v3.0.4
115+
with:
116+
template: report
117+
token: ${{ secrets.GITHUB_TOKEN }}
118+
- name: Upload CodeQL Artifacts
119+
uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2
120+
with:
121+
name: codeql-scan-results
122+
path: "./report.pdf"

0 commit comments

Comments
 (0)