如何在GitHub中禁用拉取请求? [英] How to disable pull requests in GitHub?

查看:352
本文介绍了如何在GitHub中禁用拉取请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图了解如何在github中禁用拉取请求".

问题1: 我们正在尝试使用rebase工作流,这意味着如果请求不是快速向前的推送,则使用请求请求可能会有害. 一种解决方案:为要禁用拉取请求的分支设置分支权限.或将我作为审阅者添加到所有掌握的内容中.

问题2: 这样就产生了一个问题,我可以在github中设置分支权限吗?我是否可以将自己添加为要掌握的任何更改的审阅者?

问题3: Github肯定已经删除了预接收钩子,所以如何在源到达服务器之前执行任何强制措施?可以完成预提交的挂钩,但同时可能会很痛苦.

我在这里问过类似的问题:在github上提交消息挂钩

看来github对于合并工作流甚至是git-flow可能都是有用的,但是对于rebase工作流可能很难维护,这是一个合理的假设吗?

我可以考虑将Atlassian Stash用作重新设计工作流的更好工具吗?

解决方案

如何在GitHub中禁用拉取请求?

到目前为止(2020年第二季度):不可能.

2020年9月更新,此问题在评论中指出 GitHub上的操作"Repo Lockdown" :它可以帮助防止任何新的PR GitHub存储库.

十月. 2020:" GitHub动作:微调对外部动作的访问";意味着您可以禁用将创建PR(或对存储库产生任何其他影响)的外部GitHub Action


阿敏塞巴斯蒂安 dessant/repo-lockdown ,其中.github/lockdown.yml包括

# Lock issues and pull requests
lock: true

# Limit to only `issues` or `pulls`
# only: pull


其他解决方法:

请注意(考虑到OP自2015年1月起的日期):

  • 自2015年9月起,您可以保护分支机构在GitHub存储库中.

    这意味着一个受保护的分支:

  • 不能用力推

  • 无法删除

  • 需要的状态检查之前,不能将更改合并到其中通过

  • 直到取消评论

    但是,此要求有时会在没有充分理由的情况下阻止您的团队前进.
    如果有人留下要求更改的评论,然后休假或遇到计算机问题,即使您已经解决了审阅者的疑虑,您的拉取请求也可能会被封锁数天.

    这将取消阻止您的拉取请求,使您可以自由地合并它!

    I am trying to understand how will I be able to disable "pull requests" in github.

    Question 1: We are trying to use the rebase workflow and that means using pull requests can be harmful if that isn't a fast forward push. One Solution: Setup branch permissions for the branches where I want to disable pull request. Or add me as the reviewer to anything that goes into master.

    Question 2: So that begs the question, can I setup branch permissions in github ?? Can I add myself as a reviewer for any change that wants to get into master ?

    Question 3: Github has definitely removed pre-receive hooks, so how can I do any enforcements before the source hits the server ? pre-commit hooks can be done, but at the same time can be pain.

    I had asked a similar question here: Commit message hook on github

    It seems github could be useful for the merge workflow or even git-flow, but it can be hard to maintain for the rebase workflow, is that a fair assumption ?

    Can I consider atlassian Stash as a better tool for the rebase workflow ?

    解决方案

    How to disable pull requests in GitHub?

    So far (Q2 2020): not possible.

    Update Sept. 2020, this "dear-github" issue point out in the comments to the GitHub Action "Repo Lockdown": it can help prevent any new PR on a GitHub repository.

    Oct. 2020: "GitHub Actions: Fine-tune access to external actions" means that you can disable external GitHub Action that would create PR (or have any other effect on your repository)


    Armin Sebastian suggests in GitHub issue 1191

    I've made a new app that immediately closes and locks new and existing issues or pull requests and also supports posting a comment and labeling.
    It is perfect for forks and mirrors, and you can configure it to your liking

    dessant/repo-lockdown, with a .github/lockdown.yml including

    # Lock issues and pull requests
    lock: true
    
    # Limit to only `issues` or `pulls`
    # only: pull
    


    Other workaround:

    Note that (considering the OP dates from January 2015):

    And Since October 2016, you can dismiss a review

    However, this requirement can sometimes block your team’s progress without good reason.
    If someone leaves a review that requests changes and then goes on vacation or runs into computer problems, your pull request could be blocked for days, even after you’ve addressed the reviewer’s concerns.

    This will unblock your pull request, freeing you up to merge it!

    这篇关于如何在GitHub中禁用拉取请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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