我让 Jenkins 正常运行,并且管道的规格如下。我将管道配置设置为使用具有与管道中指定的相同配置的通用 Webhook 触发器。webhook 也在我的 gitbucket 存储库中配置为仅发送推送触发器。但是当我对其进行测试时,响应为 200,并且正文响应为“已触发”:false。
管道:
pipeline {
agent any
triggers {
GenericTrigger(
genericVariables: [
[key: 'ref', value: '$.ref']
],
genericHeaderVariables: [
[key: 'X-GitHub-Event', regexpFilter: '']
],
causeString: 'Triggered on $ref',
token: '123456',
printContributedVariables: true,
printPostContent: true,
silentResponse: false,
regexpFilterText: '$ref',
regexpFilterExpression: 'refs/heads/' + 'master'
)
}
stages{...
来自 gitbucket webhook 的响应正文:
{"status":"ok","data":{"triggerResults":{"testePipeline":{"id":0,"regexpFilterExpression":"refs/heads/master","regexpFilterText":"","resolvedVariables":{"ref":"","x_github_event":"","x_github_event_0":""},"triggered":false,"url":""}}}}