Create a GitHub webhook for when a pull request is accepted & merged to master

前端 未结 2 1971
暗喜
暗喜 2021-01-31 02:17

I have a webhook that currently fires on push to any branch. This triggers the webhook far too frequently. Ideally, the webhook would only fire when a pull request

2条回答
  •  心在旅途
    2021-01-31 03:06

    I don't see any way to customize the conditions of the trigger.

    I would suggest to rather write code on the receiving end to trigger your action only when you detect that the push fits your conditions, e.g :

    • payload.ref == "refs/head/master"
    • payload.commits[0] matches the structure of a merged pull request (<- this may require getting some extra info from the commits API)

提交回复
热议问题