仅在阻止拉取请求时手动运行 GitHub Actions [英] Only run GitHub Actions manually while blocking Pull Request

查看:18
本文介绍了仅在阻止拉取请求时手动运行 GitHub Actions的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组 GitHub 操作配置为阻止合并拉取请求,直到操作成功完成.但是,每次向 PR 推送新的提交时,都会再次运行 Actions,如果作者还没有准备好合并,并且打算在未来进行更改,这可能会非常浪费.有什么方法可以让 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?

推荐答案

With 最近的更新 您现在可以将拉取请求转换回草稿状态.因此,当您需要进行更改并禁用草稿的 CI 时,您可以这样做.然后在更改完成后将草稿转换为拉取请求以重新运行 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:
      ...

这篇关于仅在阻止拉取请求时手动运行 GitHub Actions的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆