Github pull request template detect YAML front matter使用confi



我希望在GitHub中创建一个拉请求模板,GitHub能够将YAML前端问题类似于Issue_templates并将其解析为正确的字段。在Github文档中支持的文件类型=>配置。Yml它声称允许拉请求模板配置。

GitHub Docs to Example:


---
name: Name of pull request template 
about: "Use this template for setting up your PR description"
title: "Add support for the new feature"
labels: bug, enhancement, customer-request
assignees: self
---

唯一相关的信息是将键作为查询参数传递,以显示多个模板中的一个,参见下面的链接。

文档:

  • 关于issue和pull请求
  • 支持的查询参数

经过亲自测试,目前GitHub似乎不解析Pull Request模板的YAML前端问题。您可以使用单个默认模板pull_request_template.md,并且可以使用GET查询template=访问PULL_REQUEST_TEMPLATE/中的自定义模板。但是,在这两种情况下,标题块都将作为正文的一部分显示,而不被解析。

文档对此不是很清楚,但是config.yml只能用于配置问题模板选择器。目前没有拉取请求模板选择器可以配置。

您可以使用联系支持表单提交特性请求,并选择Pull requests and code review对于你的反馈是关于GitHub的哪个部分?选项。这是根据社区论坛上的答案得出的。

与此同时,解决这个问题的一种方法可能是在您的默认(pull_request_template.md)中留下一条消息,例如指向您的CONTRIBUTING.md。然后,在该文件中,您可以使用自定义GET查询为每种类型的拉取请求包含链接。例如,对于PULL_REQUEST_TEMPLATE/custom.md,链接可能是(url为方便而拆分):
https://github.com/<user>/<repo>/compare/<base>...<compare>?
template=custom.md
&title=Add+support+for+the+new+feature
&labels=bug%2Cenhancement%2Ccustomer-request
&assignees=self

根据支持的查询参数。

经过多次尝试和错误之后,您现在无法使用YAML前置事项。唯一的方法是使用URL中的查询参数。

https://github.com/url/to/pr?
template=custom_template_pr.md
&title=Add+support+for+the+new+feature
&labels=bug%2Cenhancement%2Ccustomer-request
&assignees=self

最新更新