From 771e0860ea366ddae3b8052f5bf486a3a3d4f131 Mon Sep 17 00:00:00 2001 From: Sergey Vilgelm Date: Mon, 1 Nov 2021 20:15:38 -0700 Subject: [PATCH] codeql: Remove unneeded steps Remove executing build and test, there is a special workflow for this and CodeQL does not require running any go code or building the app Remove `git checkout HEAD^2`, not needed anymore: Warning: 1 issue was detected with this workflow: git checkout HEAD^2 is no longer necessary. Please remove this step as Code Scanning recommends analyzing the merge commit for best results. Add permission to write the security events --- .github/workflows/codeql.yaml | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index 527d0651c590..4a081e0cd102 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -19,34 +19,21 @@ jobs: name: Analyze runs-on: ubuntu-latest + permissions: + # required for all workflows + security-events: write + strategy: fail-fast: false matrix: # Override automatic language detection by changing the below list # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] # TODO: Enable for javascript later - language: [ 'go' ] - golang: [ '1.16' ] - # Learn more... - # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection + language: [ 'go'] steps: - name: Checkout repository uses: actions/checkout@v2 - with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 - - # If this run was triggered by a pull request event, then checkout - # the head of the pull request instead of the merge commit. - - run: git checkout HEAD^2 - if: ${{ github.event_name == 'pull_request' }} - - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.golang }} # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL @@ -58,8 +45,5 @@ jobs: # Prefix the list here with "+" to use these queries and those in the config file. # queries: ./path/to/local/query, your-org/your-repo/queries@main - # Use manual build instead of auto build - - run: make build test - - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1