Skip to content

Commit 8154a92

Browse files
committed
Add codeQL GH workflow action
1 parent db63a9f commit 8154a92

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

.github/workflows/codeQL.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# This workflow generates weekly CodeQL reports for this repo, a security requirements.
2+
# The workflow is adapted from the following reference: https://github.com/Azure-Samples/azure-functions-python-stream-openai/pull/2/files
3+
# Generic comments on how to modify these file are left intactfor future maintenance.
4+
5+
name: "CodeQL"
6+
7+
on:
8+
push:
9+
branches: [ "dev", "*" ] # TODO: remove development branch after approval
10+
pull_request:
11+
branches: [ "dev", "*"] # TODO: remove development branch after approval
12+
schedule:
13+
- cron: '0 0 * * 1' # Weekly Monday run, needed for weekly reports
14+
workflow_call: # allows to be invoked as part of a larger workflow
15+
workflow_dispatch: # allows for the workflow to run manually see: https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow
16+
17+
env:
18+
solution: azure-functions-powershell-worker.sln
19+
config: Release
20+
21+
jobs:
22+
23+
analyze:
24+
name: Analyze
25+
runs-on: windows-latest
26+
permissions:
27+
actions: read
28+
contents: read
29+
security-events: write
30+
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: ['csharp']
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
38+
39+
steps:
40+
# Initializes the CodeQL tools for scanning.
41+
- name: Initialize CodeQL
42+
uses: github/codeql-action/init@v3
43+
with:
44+
languages: ${{ matrix.language }}
45+
# If you wish to specify custom queries, you can do so here or in a config file.
46+
# By default, queries listed here will override any specified in a config file.
47+
# Prefix the list here with "+" to use these queries and those in the config file.
48+
49+
# 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
50+
# queries: security-extended,security-and-quality
51+
52+
- uses: actions/checkout@v3
53+
with:
54+
submodules: true
55+
56+
- name: Setup .NET
57+
uses: actions/setup-dotnet@v3
58+
59+
- name: Set up .NET Core 3.1
60+
uses: actions/setup-dotnet@v3
61+
with:
62+
dotnet-version: '3.1.x'
63+
64+
- name: Restore dependencies
65+
run: dotnet restore $solution
66+
67+
- name: Build
68+
run: dotnet build $solution #--configuration $config #--no-restore -p:FileVersionRevision=$GITHUB_RUN_NUMBER -p:ContinuousIntegrationBuild=true
69+
70+
# Run CodeQL analysis
71+
- name: Perform CodeQL Analysis
72+
uses: github/codeql-action/analyze@v3
73+
with:
74+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)