From 12259bb15f13cff7bfbde06ec2c653d6f57c80ef Mon Sep 17 00:00:00 2001 From: irongut Date: Sat, 30 Jul 2022 23:06:59 +0100 Subject: [PATCH] setup codeql scanning --- .github/workflows/codeql-scan.yml | 60 +++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/codeql-scan.yml diff --git a/.github/workflows/codeql-scan.yml b/.github/workflows/codeql-scan.yml new file mode 100644 index 0000000..57b774c --- /dev/null +++ b/.github/workflows/codeql-scan.yml @@ -0,0 +1,60 @@ +name: CodeQL Scan + +on: + push: + branches: [ "master" ] + paths-ignore: + - '**/*.md' + - '**/*.gitignore' + - '**/*.gitattributes' + pull_request: + branches: [ "master" ] + schedule: + - cron: '15 5 * * 5' + +permissions: # added using https://github.com/step-security/secure-workflows + contents: read + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'csharp' ] + + steps: + + - name: Harden Runner + uses: step-security/harden-runner@74b568e8591fbb3115c70f3436a0c6b0909a8504 + with: + egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs + + - name: Checkout repository + uses: actions/checkout@d0651293c4a5a52e711f25b41b05b2212f385d28 + + - name: Initialize CodeQL + uses: github/codeql-action/init@74e8f231851deb9b54c3e408f88638dd39727868 + with: + languages: ${{ matrix.language }} + # queries: security-extended,security-and-quality # 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 + + - name: Setup .Net + uses: actions/setup-dotnet@608ee757cfcce72c2e91e99aca128e0cae67de87 + with: + dotnet-version: 6.0.x + + - name: Restore Dependencies + run: dotnet restore src/CodeCoverageSummary.sln + + - name: Build CodeCoverageSummary + run: dotnet build src/CodeCoverageSummary.sln --configuration Release --no-restore + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@74e8f231851deb9b54c3e408f88638dd39727868