Github问题模板验证(必需:true)不起作用

问题描述 投票:0回答:1

我正在尝试创建一个 Github 问题模板,我想在允许用户提交问题之前验证填写的字段。

我正在使用

validations
提交,但Gthub似乎没有注册它...

    validations:
      required: true

我的问题模板

yml
文件:

name: Test template
description: Fill out the test template.
title: "[Test]: "
body:
  - type: markdown
    attributes:
      value: |
        ## Thank you for taking the time to fill out this test template
  - type: textarea
    id: description
    attributes:
      label: Describe your issue
      placeholder: Issue
    validations:
      required: true


结果:


期望:

  • 描述您的问题”字段应为必填项,并带有红色星号
  • 当字段为空时,应禁用“提交新问题”按钮

我不确定我做错了什么。有什么想法吗?

谢谢

github templates github-issues
1个回答
0
投票

因为我遇到了同样的问题,所以我假设您的存储库设置为“私有”。为了使“必填”字段按预期工作,您必须将存储库设置为“公共”。

根据 GitHub 的文档

注意:必填字段密钥仅在公共存储库中受支持。在私人和内部存储库中,所有字段都是可选的。

https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms

© www.soinside.com 2019 - 2024. All rights reserved.