我可以让 Github 在创建评论时自动将一组人添加到评论中吗?
理想情况下,我想创建一组人,并且只有当该组中至少有一个人接受了更改时才能合并。
这群人将是该领域的中小企业。其他审阅者可以发表评论并接受,但只有至少一个 SME 接受更改后,PR 才能被合并。
是否可以在 Github 上不使用 hooks 来实现?
是的,您无需 Webhooks 即可完成所有这一切!
对于设置“审批组”的问题,可以使用文件CODEOWNERS来设置。
来自Github 文档(重点是我的):
使用 CODEOWNERS 文件定义负责存储库中代码的个人或团队。
当有人打开修改其拥有的代码的拉取请求时,代码所有者会自动请求审核。当具有管理员权限的人启用了必要的审查时,他们可以选择要求代码所有者的批准。
文件的格式CODEOWNERS与 a 类似.gitignore,但每个范围旁边都有 Github 用户名。使用与文件相同的规则定义范围.gitignore。
(有关示例文件,请参阅本答案的末尾CODEOWNERS。)
如果您在 Github 存储库中设置受保护的分支,您还可以启用所需的审查。
来自Github 文档(再次强调我的文档):
存储库管理员可以要求所有拉取请求在合并到受保护的分支之前,至少收到具有写入或管理权限的人员或指定代码所有者的批准审查。
启用必要的审查后,任何有权访问存储库的人都可以批准拉取请求中的更改。但是,要合并您的拉取请求,您需要在存储库中具有写入或管理权限的人员才能在其审核中批准您的拉取请求的更改。如果需要指定代码所有者的审核,并且拉取请求影响具有指定所有者的代码,则需要获得该所有者的批准。
# 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
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5501 次 |
| 最近记录: |