Skip to content

Commit f47f4f5

Browse files
authored
codeql: Remove unneeded steps (#2336)
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
1 parent 8cb9c76 commit f47f4f5

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

Diff for: .github/workflows/codeql.yaml

+5-21
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,21 @@ jobs:
1919
name: Analyze
2020
runs-on: ubuntu-latest
2121

22+
permissions:
23+
# required for all workflows
24+
security-events: write
25+
2226
strategy:
2327
fail-fast: false
2428
matrix:
2529
# Override automatic language detection by changing the below list
2630
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
2731
# TODO: Enable for javascript later
28-
language: [ 'go' ]
29-
golang: [ '1.16' ]
30-
# Learn more...
31-
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
32+
language: [ 'go']
3233

3334
steps:
3435
- name: Checkout repository
3536
uses: actions/checkout@v2
36-
with:
37-
# We must fetch at least the immediate parents so that if this is
38-
# a pull request then we can checkout the head.
39-
fetch-depth: 2
40-
41-
# If this run was triggered by a pull request event, then checkout
42-
# the head of the pull request instead of the merge commit.
43-
- run: git checkout HEAD^2
44-
if: ${{ github.event_name == 'pull_request' }}
45-
46-
- name: Install Go
47-
uses: actions/setup-go@v2
48-
with:
49-
go-version: ${{ matrix.golang }}
5037

5138
# Initializes the CodeQL tools for scanning.
5239
- name: Initialize CodeQL
@@ -58,8 +45,5 @@ jobs:
5845
# Prefix the list here with "+" to use these queries and those in the config file.
5946
# queries: ./path/to/local/query, your-org/your-repo/queries@main
6047

61-
# Use manual build instead of auto build
62-
- run: make build test
63-
6448
- name: Perform CodeQL Analysis
6549
uses: github/codeql-action/analyze@v1

0 commit comments

Comments
 (0)