Skip to content

Commit 22d9fd4

Browse files
committed
Use credentialsId for Jenkins
1 parent 0fad675 commit 22d9fd4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Jenkinsfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,14 @@ def cancel_previous_build() {
118118
}
119119

120120
def should_skip_ci(pr_number) {
121-
withCredentials([string(credentialsId: 'jenkins-reader-apache', variable: 'TOKEN')]) {
121+
withCredentials([usernamePassword(
122+
credentialsId: 'jenkins-reader-apache',
123+
usernameVariable: 'GITHUB_APP',
124+
passwordVariable: 'TOKEN',
125+
)]) {
122126
run_full_ci = sh (
123127
returnStatus: true,
124-
script: "./tests/scripts/git_skip_ci.py '${pr_number}'",
128+
script: "./tests/scripts/git_skip_ci.py --pr '${pr_number}'",
125129
label: 'Check if CI should be skipped',
126130
)
127131
}
@@ -164,11 +168,11 @@ stage('Sanity Check') {
164168
script: './tests/scripts/git_change_docs.sh',
165169
label: "Check for docs only changes",
166170
)
171+
skip_ci = should_skip_ci(env.CHANGE_ID)
167172
sh (
168173
script: "${docker_run} ${ci_lint} ./tests/scripts/task_lint.sh",
169174
label: "Run lint",
170175
)
171-
skip_ci = should_skip_ci(env.CHANGE_ID)
172176
}
173177
}
174178
}

0 commit comments

Comments
 (0)