add workflow for code ql

This commit is contained in:
John Jenusaitis 2025-08-13 13:23:17 -04:00
parent 64e3ffec43
commit cfc2809cca

View file

@ -0,0 +1,63 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# Reach out on Teams at 'Corp DevOps / Github Community' to get help.
name: "CodeQL - Default"
on:
push:
branches: ['master']
pull_request:
# The branches below must be a subset of the branches above
branches: [ '**' ]
schedule:
- cron: '10 22 9 * *'
workflow_dispatch:
jobs:
analyze:
name: Analyze
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || (matrix.language == 'csharp' && 'windows-latest') || 'ubuntu-latest' }}
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
# TODO: The language array below is purposefully left blank. You will need to update it with the language or languages this repo contains before this action will succeed
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
language: ['csharp']
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config-default.yml
queries: security-extended
# 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
# queries: security-extended,security-and-quality
- name: Autobuild
uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
env:
ARTIFACTORY_NPM_REGISTRY: ${{secrets.SCRATCH_ARTIFACTORY_NPM_REGISTRY}}
ARTIFACTORY_NUGET_REGISTRY: ${{secrets.SCRATCH_ARTIFACTORY_NUGET_REGISTRY}}
ARTIFACTORY_PASSWORD: ${{secrets.SCRATCH_ARTIFACTORY_PASSWORD}}
ARTIFACTORY_TOKEN: ${{secrets.SCRATCH_ARTIFACTORY_TOKEN}}
ARTIFACTORY_USERNAME: ${{secrets.SCRATCH_ARTIFACTORY_USERNAME}}