From 12f878028d70e5ea220e2e5936707c114c60b8da Mon Sep 17 00:00:00 2001 From: Dominion Date: Wed, 7 Jun 2023 08:02:54 -0400 Subject: [PATCH] Move code scanning to its own actions file - It can work and only work on `pull_request`, not `pull_request_target` --- .github/workflows/ci-suite.yml | 38 ------------------------- .github/workflows/code-scanning.yml | 44 +++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/code-scanning.yml diff --git a/.github/workflows/ci-suite.yml b/.github/workflows/ci-suite.yml index 7fd6134029..ccdaa58af9 100644 --- a/.github/workflows/ci-suite.yml +++ b/.github/workflows/ci-suite.yml @@ -55,44 +55,6 @@ jobs: - name: GitHub Requires at Least One Step for a Job run: exit 0 - analyze: - name: Code Scanning - needs: start-ci-run-gate - if: "!(cancelled() || failure()) && needs.start-ci-run-gate.result == 'success'" - runs-on: ubuntu-latest - steps: - - name: Install Node 12.X - uses: actions/setup-node@v3 - with: - node-version: 12.x - - - name: Upgrade NPM - run: npm install -g npm - - - name: Checkout (Branch Push) - uses: actions/checkout@v3 - if: github.event_name == 'push' - with: - fetch-depth: 2 - - - name: Checkout (PR Merge) - uses: actions/checkout@v3 - if: github.event_name != 'push' - with: - fetch-depth: 2 - ref: "refs/pull/${{ github.event.number }}/merge" - - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: csharp - - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - dmapi-build: name: Build DMAPI needs: start-ci-run-gate diff --git a/.github/workflows/code-scanning.yml b/.github/workflows/code-scanning.yml new file mode 100644 index 0000000000..4118c5b1cf --- /dev/null +++ b/.github/workflows/code-scanning.yml @@ -0,0 +1,44 @@ +name: 'Code Scanning' + +on: + schedule: + - cron: 0 23 * * * + push: + branches: + - dev + - master + pull_request: + branches: + - dev + - master + +concurrency: + group: "code-scanning-${{ github.head_ref || github.run_id }}-${{ github.event_name }}" + cancel-in-progress: true + +jobs: + analyze: + name: Code Scanning + runs-on: ubuntu-latest + steps: + - name: Install Node 12.X + uses: actions/setup-node@v3 + with: + node-version: 12.x + + - name: Upgrade NPM + run: npm install -g npm + + - name: Checkout + uses: actions/checkout@v3 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: csharp + + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2