Skip to content

Commit b68c81c

Browse files
authored
add codeQL support (#337)
1 parent 5022a62 commit b68c81c

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed

.github/workflows/codeQL.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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: [ "main", "*" ] # TODO: remove development branch after approval
10+
pull_request:
11+
branches: [ "main", "*"] # 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: Microsoft.DurableTask.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+
with:
59+
global-json-file: global.json
60+
61+
- name: Restore dependencies
62+
run: dotnet restore $solution
63+
64+
- name: Build
65+
run: dotnet build $solution #--configuration $config #--no-restore -p:FileVersionRevision=$GITHUB_RUN_NUMBER -p:ContinuousIntegrationBuild=true
66+
67+
# Run CodeQL analysis
68+
- name: Perform CodeQL Analysis
69+
uses: github/codeql-action/analyze@v3
70+
with:
71+
category: "/language:${{matrix.language}}"

eng/ci/official-build.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@ trigger:
1616
# CI only, does not trigger on PRs.
1717
pr: none
1818

19+
schedules:
20+
# Build nightly to catch any new CVEs and report SDL often.
21+
# We are also required to generated CodeQL reports weekly, so this
22+
# helps us meet that.
23+
- cron: "0 0 * * *"
24+
displayName: Nightly Build
25+
branches:
26+
include:
27+
- main
28+
always: true
29+
1930
resources:
2031
repositories:
2132
- repository: 1es

0 commit comments

Comments
 (0)