GitHub 不会在发布更改时重新触发 webhook
GitHub does not re-trigger webhook on Release changes
对于我的 https://github.com/bkimminich/juice-shop 项目,我使用 Sourceforge (https://sourceforge.net/p/juice-shop/files/github_webhook
) 提供的 webhook 在 GitHub 触发 Release
事件时在那里创建一个版本。此 webhook 获取所有附加到版本(GitHub)的文件并将它们上传到 Sourceforge。到目前为止,还不错。
我现在的问题是,在 CI/CD 过程 之后,我将更多文件附加到发行版 ,即基于 Tavis-CI 和 Appveyor。这些不会进入 Sourceforge,因为当最初执行 webhook 时它们还不存在。 GitHub 版本的更改(即附加更多文件)似乎不会自动重新触发 webhook。
此问题的解决方法是手动重新触发最后一次 webhook 调用,然后它将拾取所有文件,包括后来添加的文件,并将它们上传到 Sourceforge。
但这是一个手动过程,所以它有点破坏了我的自动化链中的最后一步。有没有办法正确地自动执行此操作?
这是 GitHub 支持团队的官方回答,明确建议使用第一个选项:
don't publish a release before you have all the files in it. Instead, create a pre-release or a draft release, then trigger
Travis/Appveyor to build the files you need, then add the files to the
release, and finally publish the release. The webhook will be
triggered when the release is published at which point all the files
will be present.
after you update the release with the additional files, use the API to fetch those files and upload them to SourceForge. I'm not sure if
SourceForge provides the APIs necessary to do this on their end, so
you'd need to ask them for advice.
after you update the release with the additional files, un-publish the release and publish it again. This should trigger the webhook
again and you can do this step via the API.
对于我的 https://github.com/bkimminich/juice-shop 项目,我使用 Sourceforge (https://sourceforge.net/p/juice-shop/files/github_webhook
) 提供的 webhook 在 GitHub 触发 Release
事件时在那里创建一个版本。此 webhook 获取所有附加到版本(GitHub)的文件并将它们上传到 Sourceforge。到目前为止,还不错。
我现在的问题是,在 CI/CD 过程 之后,我将更多文件附加到发行版 ,即基于 Tavis-CI 和 Appveyor。这些不会进入 Sourceforge,因为当最初执行 webhook 时它们还不存在。 GitHub 版本的更改(即附加更多文件)似乎不会自动重新触发 webhook。
此问题的解决方法是手动重新触发最后一次 webhook 调用,然后它将拾取所有文件,包括后来添加的文件,并将它们上传到 Sourceforge。
但这是一个手动过程,所以它有点破坏了我的自动化链中的最后一步。有没有办法正确地自动执行此操作?
这是 GitHub 支持团队的官方回答,明确建议使用第一个选项:
don't publish a release before you have all the files in it. Instead, create a pre-release or a draft release, then trigger Travis/Appveyor to build the files you need, then add the files to the release, and finally publish the release. The webhook will be triggered when the release is published at which point all the files will be present.
after you update the release with the additional files, use the API to fetch those files and upload them to SourceForge. I'm not sure if SourceForge provides the APIs necessary to do this on their end, so you'd need to ask them for advice.
after you update the release with the additional files, un-publish the release and publish it again. This should trigger the webhook again and you can do this step via the API.