仅在阻止请求请求时手动运行GitHub Actions

问题描述:

我有一组GitHub Actions配置为阻止合并合并请求请求,直到Actions成功完成.但是,每次将新提交提交到PR时,操作都会再次运行,如果作者尚未准备好合并并打算进行将来的更改,那么这将非常浪费.有什么办法让GitHub Action仍然阻止PR合并但又不自动运行Action?

I have a set of GitHub Actions configured to block pull requests from being merged until the Actions complete successfully. However, every time a new commit is pushed to a PR, the Actions are run again, which can be very wasteful if the author is not yet ready to merge, and intends to make future changes. Is there any way to have a GitHub Action still block a PR being merged but also not run the Action automatically?

使用此最新更新,您现在可以将拉取请求转换回草稿状态.因此,当您需要进行更改并禁用草稿的配置项时,可以执行此操作.更改完成后,将草稿转换为请求请求以重新运行CI.

With this recent update you can now convert pull requests back to draft status. So you could do that when you need to make changes and disable the CI for drafts. Then convert the draft to a pull request after the changes are complete to rerun CI.

on: pull_request
jobs:
  build:
    if: github.event.pull_request.draft == 'false'
    runs-on: ubuntu-latest
    steps:
      ...