Skip to content

Commit acdd5d0

Browse files
authored
Update Jenkinsfile
1 parent 1c83b54 commit acdd5d0

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

jenkins/Jenkinsfile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,17 @@ pipeline {
3030

3131
stage('CodeQL Analysis') {
3232
steps {
33-
sh '''#!/bin/bash
34-
. venv/bin/activate
35-
echo "Base Ref (Target Branch): $CHANGE_TARGET"
36-
echo "Ref (Source Branch): $CHANGE_BRANCH"
37-
38-
curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/user
39-
40-
codeql-wrapper --verbose analyze ./monorepo --monorepo --upload-sarif --ref $CHANGE_BRANCH --base-ref $CHANGE_TARGET
41-
'''
33+
withCredentials([string(credentialsId: 'PAT', variable: 'GITHUB_TOKEN')]) {
34+
sh '''#!/bin/bash
35+
. venv/bin/activate
36+
echo "Base Ref (Target Branch): $CHANGE_TARGET"
37+
echo "Ref (Source Branch): $CHANGE_BRANCH"
38+
39+
curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/user
40+
41+
codeql-wrapper --verbose analyze ./monorepo --monorepo --upload-sarif --ref $CHANGE_BRANCH --base-ref $CHANGE_TARGET
42+
'''
43+
}
4244
}
4345
}
4446
}

0 commit comments

Comments
 (0)