Skip to content

Commit fc5621a

Browse files
Update Jenkinsfile to use correct credentials ID for GITHUB_TOKEN in CodeQL Analysis stage
1 parent ebb96f2 commit fc5621a

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

jenkins/Jenkinsfile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ pipeline {
22
agent any
33

44
environment {
5-
GITHUB_TOKEN = credentials('PAT')
5+
GITHUB_TOKEN = credentials('PAT2')
66
}
77

88
stages {
@@ -29,15 +29,17 @@ pipeline {
2929

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

0 commit comments

Comments
 (0)