Mic*_*nik 5 github github-api pull-request
GitHub 允许创建PR 模板。除了拉取请求审查之外,是否可以做同样的事情?
例如,添加审核清单,如下所示:
- [] Have all the GitHub checks passed?
- [] Is there any redundant code?
- [] Could any optimization be applied?
Run Code Online (Sandbox Code Playgroud)
在 GitHub 中,没有用于拉取请求审核的模板。GitHub 操作允许您在草稿 PR 更改为状态时执行某些操作ready_for_review:
on:\n pull_request_target:\n types:\n - ready_for_review\nRun Code Online (Sandbox Code Playgroud)\n例如,您可以在此步骤中发布包含复选框的评论,例如 us\xc3\xadng marocchino/sticky-pull-request-comment。我在此 PR中创建了一条评论,我对它的效果感到非常兴奋。
\n完整的 GitHub 操作示例:
\nname: "Pull request checklist"\non:\n pull_request_target:\n types:\n - ready_for_review\njobs:\n pull_request_info:\n runs-on: ubuntu-latest\n steps:\n - name: Extract branch name\n shell: bash\n run: echo "##[set-output name=branch;]$(echo ${GITHUB_HEAD_REF})"\n id: extract_branch\n\n - name: Checkout repository\n uses: actions/checkout@v3\n with:\n fetch-depth: 0\n\n - name: Show checklist\n uses: marocchino/sticky-pull-request-comment@v2\n with:\n header: show_checklist\n message: |\n - [ ] Checklist item 1\n - [ ] Checklist item 2\nRun Code Online (Sandbox Code Playgroud)\n如需更多选项,请查看:
\n\n