Fil*_*ill 21 github pull-request
根据文档,我必须在文件夹PULL_REQUEST_TEMPLATE中创建一个文件夹.github。
然后将 mypull_request_first_template和添加pull_request_second_template.md到文件夹中PULL_REQUEST_TEMPLATE。
当我尝试打开一个新的 PR 时,没有显示任何模板,更不用说在它们之间进行切换了。
似乎模板根本不显示。有解决办法吗?
小智 27
您可以创建手动模板选择,这样至少打开 PR 的开发人员可以单击链接来访问各自的模板:
假设您有两个模板group_a_template.md及group_b_template.md以下.github/PULL_REQUEST_TEMPLATE
.github/pull_request_template.md使用以下内容创建默认模板
Please go the the `Preview` tab and select the appropriate sub-template:
* [Group A](?expand=1&template=group_a_template.md)
* [Group B](?expand=1&template=group_b_template.md)
Run Code Online (Sandbox Code Playgroud)
这样,在 UI 中以交互方式打开 PR 的人将首先进入默认模板,并可以从“预览”视图中打开各自的目标模板。
不是最佳方案,但比每次提交 PR 时手动修补 URL 更方便。
简短的回答,是的,有一个解决方案。然而,有几个步骤可以实现这一点:
.github/或目录。docs/PULL_REQUEST_TEMPLATE。template_one.md和template_two.md。我的示例 URL 如下所示:https://github.com/<org>/<repo-name>/compare/main...test-branch?template=template_one.md