答案1
如果您使用 Job DSL 建立管道作業,則可以將憑證設定為:
scm {
git {
remote {
github('account/repo', 'ssh')
credentials('github-ci-key')
}
}
}
看https://jenkinsci.github.io/job-dsl-plugin/#path/pipelineJob-definition-cpsScm-scm-git