Skip to content

Commit 2df8b37

Browse files
authored
Add codeQL (#517)
1 parent e0ea8a3 commit 2df8b37

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed

.github/workflows/codeQL.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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" ]
10+
pull_request:
11+
branches: [ "main" ]
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+
jobs:
18+
19+
analyze:
20+
name: Analyze
21+
runs-on: windows-latest
22+
permissions:
23+
actions: read
24+
contents: read
25+
security-events: write
26+
27+
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
language: ['python']
32+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
33+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
34+
35+
steps:
36+
# Initializes the CodeQL tools for scanning.
37+
- name: Initialize CodeQL
38+
uses: github/codeql-action/init@v3
39+
with:
40+
languages: ${{ matrix.language }}
41+
# If you wish to specify custom queries, you can do so here or in a config file.
42+
# By default, queries listed here will override any specified in a config file.
43+
# Prefix the list here with "+" to use these queries and those in the config file.
44+
45+
# 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
46+
# queries: security-extended,security-and-quality
47+
48+
- uses: actions/checkout@v3
49+
with:
50+
submodules: true
51+
52+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
53+
# If this step fails, then you should remove it and run the build manually (see below)
54+
- name: Autobuild
55+
uses: github/codeql-action/autobuild@v2
56+
57+
# Run CodeQL analysis
58+
- name: Perform CodeQL Analysis
59+
uses: github/codeql-action/analyze@v3
60+
with:
61+
category: "/language:${{matrix.language}}"

eng/ci/official-build.yml

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

14+
schedules:
15+
# Build nightly to catch any new CVEs and report SDL often.
16+
# We are also required to generated CodeQL reports weekly, so this
17+
# helps us meet that.
18+
- cron: "0 0 * * *"
19+
displayName: Nightly Build
20+
branches:
21+
include:
22+
- main
23+
always: true
24+
1425
resources:
1526
repositories:
1627
- repository: 1es

0 commit comments

Comments
 (0)