@@ -2,9 +2,13 @@ name: "Code scanning - action"
22
33on:
44 push:
5+ branches: [master, ]
6+ pull_request:
7+ # The branches below must be a subset of the branches above
8+ branches: [master]
59 schedule:
6− - cron: '0 0 * * 0'
7−
10+ - cron: '0 15 * * 2'
11+
812jobs:
913 CodeQL-Build:
1014
@@ -17,6 +21,15 @@ jobs:
1721 steps:
1822 - name: Checkout repository
1923 uses: actions/checkout@v2
24+ with:
25+ # We must fetch at least the immediate parents so that if this is
26+ # a pull request then we can checkout the head.
27+ fetch-depth: 2
28+
29+ # If this run was triggered by a pull request event, then checkout
30+ # the head of the pull request instead of the merge commit.
31+ - run: git checkout HEAD^2
32+ if: ${{ github.event_name == 'pull_request' }}
2033
2134 # Initializes the CodeQL tools for scanning.
2235 - name: Initialize CodeQL