Skip to content

Commit b5f4014

Browse files
committed
add workflow of CodeQL Analysis
1 parent b1f21d0 commit b5f4014

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed

.github/codeql/configurations.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SPDX-License-Identifier: MIT
2+
# SPDX-FileCopyrightText: "2022 smdn <smdn@smdn.jp>"
3+
4+
# ref: https://docs.github.com/ja/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-a-custom-configuration-file
5+
name: "CodeQL configurations"
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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+
# ref: https://docs.microsoft.com/en-us/dotnet/devops/dotnet-secure-github-action
15+
on:
16+
push:
17+
branches: [ main ]
18+
paths:
19+
- 'src/**/*.cs'
20+
- 'src/**/*.csproj'
21+
pull_request:
22+
# The branches below must be a subset of the branches above
23+
branches: [ main ]
24+
paths:
25+
- 'src/**/*.cs'
26+
- 'src/**/*.csproj'
27+
schedule:
28+
- cron: '13 20 03,16 * *'
29+
workflow_dispatch:
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: [ 'csharp' ]
44+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
45+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
46+
47+
steps:
48+
- name: Checkout repository
49+
uses: actions/checkout@v2
50+
51+
# Initializes the CodeQL tools for scanning.
52+
- name: Initialize CodeQL
53+
uses: github/codeql-action/init@v1
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+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
60+
config-file: ./.github/codeql/configurations.yml
61+
62+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
63+
# If this step fails, then you should remove it and run the build manually (see below)
64+
- name: Autobuild
65+
uses: github/codeql-action/autobuild@v1
66+
67+
# ℹ️ Command-line programs to run using the OS shell.
68+
# 📚 https://git.io/JvXDl
69+
70+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
71+
# and modify them (or add more) to build your code if your project
72+
# uses a compiled language
73+
74+
#- run: |
75+
# make bootstrap
76+
# make release
77+
78+
- name: Perform CodeQL Analysis
79+
uses: github/codeql-action/analyze@v1

0 commit comments

Comments
 (0)