Skip to content

Commit f35da3e

Browse files
authored
Code QL analysis should be done on correct commit (#6638)
* Only run CodeQL on important branches and when pushing to master * Scan the merge commit directly
1 parent 167a855 commit f35da3e

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

.github/workflows/codeql.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ name: "Code scanning - action"
22

33
on:
44
push:
5+
branches: [ 'master', 'stable*', 'v[0-9]*' ]
56
pull_request:
7+
# The branches below must be a subset of the branches above
8+
branches: [ master ]
69
schedule:
710
- cron: '0 19 * * 0'
811

@@ -18,15 +21,6 @@ jobs:
1821
steps:
1922
- name: Checkout repository
2023
uses: actions/checkout@main
21-
with:
22-
# We must fetch at least the immediate parents so that if this is
23-
# a pull request then we can checkout the head.
24-
fetch-depth: 2
25-
26-
# If this run was triggered by a pull request event, then checkout
27-
# the head of the pull request instead of the merge commit.
28-
- run: git checkout HEAD^2
29-
if: ${{ github.event_name == 'pull_request' }}
3024

3125
# Initializes the CodeQL tools for scanning.
3226
- name: Initialize CodeQL

0 commit comments

Comments
 (0)