1

现在使用 webhook 拉取请求更新事件,我会收到任何拉取请求更新的通知(例如:描述更新、标题更改等)

有没有办法只在对拉取请求进行推送时才收到通知?

4

1 回答 1

1

不,每次拉取请求发生变化时都会触发 webhook。

但是,查看通过 webhook获得的有效负载pullrequest:updated,您可以自己构建该逻辑,方法是将源提交哈希与先前(存储的)哈希进行比较。如果它们不同,则意味着进行了推送。

有效载荷片段:

{
   "id" :  1 ,
   "title" :  "Title of pull request" ,
   "description" :  "Description of pull request" ,
   "state" :  "OPEN|MERGED|DECLINED" ,
   "author" : User,
   "source" : {
    "branch" : {  "name" :  "branch2" },
    "commit" : {  "hash" :  "d3022fc0ca3d" },
    "repository" : Repository
   }
}
于 2015-08-16T15:39:47.550 回答