Skip to content

Commit fe3f489

Browse files
Refactor CodeQL analysis workflow to correctly set GitHub base and reference variables
1 parent f146d0e commit fe3f489

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

.github/workflows/test-code-scanning-only-changed-projects.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@ name: codeql-wrapper-monorepo-only-changed-files
33

44
# Trigger workflow
55
on:
6+
push:
7+
branches:
8+
- main
69
pull_request:
710
workflow_dispatch:
8-
push:
11+
912
jobs:
1013
codeql-analysis:
1114
name: codeql-wrapper-monorepo-pr

circle_ci/codeql_analysis_pr.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ jobs:
2525
name: Run CodeQL Analysis
2626
command: |
2727
export GITHUB_TOKEN=${PAT} # Set PAT as environment variable in CircleCI project settings
28-
#export GITHUB_BASE_REF=<< pipeline.event.github.pull_request.base.ref >>
29-
#export GITHUB_REF=refs/pull/<< pipeline.event.github.pull_request.number >>/merge
28+
export GITHUB_BASE_REF=<< pipeline.event.github.pull_request.base.ref >>
29+
export GITHUB_REF=refs/pull/<< pipeline.event.github.pull_request.number >>/merge
3030
curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/user
31-
printenv
3231
codeql-wrapper --verbose analyze ./monorepo \
3332
--monorepo \
3433
--upload-sarif \
3534
--only-changed-files \
36-
--max-workers 1
35+
--base-ref origin/"$GITHUB_BASE_REF" \
36+
--ref "$GITHUB_REF"
3737
3838
workflows:
3939
version: 2

0 commit comments

Comments
 (0)