gpt4 book ai didi

templates - Github pull request 模板使用 config.yml 检测 YAML front matter 并应用于字段

转载 作者:行者123 更新时间:2023-12-05 04:52:46 25 4
gpt4 key购买 nike

我希望在 GitHub 中创建一个拉取请求模板,其中 Github 能够获取类似于 Issue_templates 的 YAML 前端内容并将其解析为正确的字段。在 Supported file types 下的 Github 文档中=> config.yml 它声称允许拉取请求模板配置。

GitHub Docs到下面的例子:


---
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
---

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

文档:

最佳答案

经个人测试,目前 GitHub 似乎没有解析 Pull Request 模板的 YAML front matter。您可以拥有一个默认模板 pull_request_template.md,并在 PULL_REQUEST_TEMPLATE/ 中使用 GET 查询 template= 访问自定义模板。然而,在这两种情况下,前面的内容 block 将显示为正文的一部分,而不是被解析。

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

您可以使用 contact support form 提交功能请求,并为 GitHub 的哪一部分是您的反馈? 选项选择拉取请求和代码审查。那是根据this answer在社区论坛上。

与此同时,解决此问题的一种方法可能是在您的默认 (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

根据 supported query params .

关于templates - Github pull request 模板使用 config.yml 检测 YAML front matter 并应用于字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66392676/

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