Skip to content

Commit

Permalink
codeql: Remove unneeded steps
Browse files Browse the repository at this point in the history
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
  • Loading branch information
SVilgelm committed Nov 2, 2021
1 parent a2b2968 commit 771e086
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 771e086

Please sign in to comment.