Skip to content

Commit 6b8114c

Browse files
ci: Run CodeQL action on all PRs (#3698)
This action only is triggered on PRs to `master`, but the action is required. This becomes a problem when a PR is opened against a branch other than `master` (e.g. as part of a PR tree). When the parent branch is merged to `master`, the PR's base automatically changes to `master`, but this action does not get triggered. Instead, it blocks on "Expected" and can only be run by adding commits to the branch. Running the action on PRs against any branch should fix this. Also, add logic to cancel in-progress workflows on pull requests (logic taken from our other actions)
1 parent 483a0bd commit 6b8114c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/codeql-analysis.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ on:
1717
- master
1818
- sentry-sdk-2.0
1919
pull_request:
20-
# The branches below must be a subset of the branches above
21-
branches:
22-
- master
23-
- sentry-sdk-2.0
2420
schedule:
2521
- cron: '18 18 * * 3'
2622

23+
# Cancel in progress workflows on pull_requests.
24+
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
27+
cancel-in-progress: true
28+
2729
permissions:
2830
contents: read
2931

0 commit comments

Comments
 (0)