我找不到执行此 *** 作的插件,所以我确实使用了curl。这是我的常规功能
def call(def text_pr) { def repository_url = scm.userRemoteConfigs[0].url def repository_name = repository_url.replace("git@github.com:","").replace(".git","") withCredentials([string(credentialsId: '<YOUR-TOKEN-ID>', variable: 'GITHUB_TOKEN')]) { sh "curl -s -H "Authorization: token ${GITHUB_TOKEN}" -X POST -d '{"body": "${text_pr}"}' "https://api.github.com/repos/${repository_name}/issues/${ghprbPullId}/comments"" }}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)