gpt4 book ai didi

Github 群评

转载 作者:行者123 更新时间:2023-12-04 20:40:02 25 4
gpt4 key购买 nike

我可以让 Github 在创建评论时自动将一组人添加到评论中吗?

理想情况下,我想创建一组人,并且只有在该组中至少有一个人接受了更改时才能合并。

这群人将是该领域的中小企业。其他审稿人可以评论和接受,但只有至少有一个 SME 接受了更改,才能合并 PR。

是否可以在不使用钩子(Hook)的情况下在 Github 中做到这一点?

最佳答案

是的,您可以在没有 webhook 的情况下完成所有这些操作!
审批组
关于设置“审批组”的问题,可以使用 CODEOWNERS 文件来设置它。
来自 the Github docs (强调我的):

Use a CODEOWNERS file to define individuals or teams that are responsible for code in a repository.

Code owners are automatically requested for review when someone opens a pull request that modifies code that they own. When someone with admin permissions has enabled required reviews, they can optionally require approval from a code owner.

CODEOWNERS 的格式文件类似于 .gitignore ,但在每个范围旁边都有 Github 用户名。使用与 .gitignore 相同的规则定义范围。文件。
(有关示例 CODEOWNERS 文件,请参阅此答案的末尾。)
需要的评论
如果您 setup protected branches in your Github repository ,您也可以启用 required reviews .
来自 the Github docs (再次强调我的):

Repository administrators can require that all pull requests receive at least one approved review from someone with write or admin permissions or from a designated code owner before they're merged into a protected branch.

When required reviews are enabled, anyone with access to the repository can approve changes in a pull request. However, to merge your pull request you need someone who has write or admin permissions in the repository to approve your pull request's changes in their review. If review is required from a designated code owner and the pull request affects code that has a designated owner, approval from that owner is required.



CODEOWNERS 文件示例(来自 the Github docs):
# This is a comment.

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.
* @global-owner1 @global-owner2

# Order is important; the last matching pattern takes the most
# precedence. When someone opens a pull request that only
# modifies JS files, only @js-owner and not the global
# owner(s) will be requested for a review.
*.js @js-owner

# You can also use email addresses if you prefer. They'll be
# used to look up users just like we do for commit author
# emails.
*.go docs@example.com

# In this example, @doctocat owns any files in the build/logs
# directory at the root of the repository and any of its
# subdirectories.
/build/logs/ @doctocat

# The `docs/*` pattern will match files like
# `docs/getting-started.md` but not further nested files like
# `docs/build-app/troubleshooting.md`.
docs/* docs@example.com

# In this example, @octocat owns any file in an apps directory
# anywhere in your repository.
apps/ @octocat

# In this example, @doctocat owns any file in the `/docs`
# directory in the root of your repository.
/docs/ @doctocat

关于Github 群评,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45806336/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com