创建GitHub Issue表单时触发YAML语法错误(行1列1)求助
GitHub Issue表单YAML解析错误修复方案
创建GitHub Issue表单时遭遇YAML解析错误:YAML syntax error: (): did not find expected key while parsing a block mapping at line 1 column 1,修改name字段无法解决问题,最终通过调整配置修复。
原代码的核心问题
- 缩进不一致:部分
- type: ...行前多了多余空格,YAML对缩进极度敏感,层级混乱直接导致解析失败。 - 结构嵌套错误:Checkbox组件的
options被错误放在attributes节点外部,不符合GitHub Issue表单的YAML结构规范。
修复后的完整YAML代码
name: Bug report description: 提交WinUEFI需要修复的Bug title: "[BUG] <标题>" labels: [bug] body: - type: markdown attributes: value: | 感谢你提交WinUEFI的Bug反馈!这有助于我优化应用。请尽可能详细描述,方便我排查和处理。 提交前请先搜索现有Issue,避免重复反馈。若已有相关Issue,可在下方补充信息。 提交Bug前,请确保你使用的是最新版本,且该Bug未在最新版WinUEFI中被修复。 - type: textarea id: bug-and-suggestion-relation attributes: label: 该Bug是否与某个功能建议相关? description: 请说明该Bug的背景,以及你希望修复它的原因。 validations: required: true - type: textarea id: bug-description attributes: label: 描述Bug description: 清晰、简洁地说明Bug现象及需要修复的内容。 validations: required: true - type: textarea id: alternatives attributes: label: 你尝试过的替代方案 description: 列出你为修复该Bug尝试过的所有替代方法。 - type: checkboxes id: agreements attributes: label: 确认事项 description: 请确认以下内容: options: - label: 我已搜索过,确认没有相同的已提交Issue。 required: true - label: 我已确认该Bug在WinUEFI最新支持版本中未被修复。 required: true - type: textarea id: other attributes: label: 其他补充 description: 在此添加该Bug的其他上下文信息或截图。
关键修复点
- 统一所有列表项缩进:所有
- type: ...行保持2个空格缩进,避免层级混乱。 - 修正
options嵌套层级:将Checkbox的options移至attributes节点内,匹配GitHub官方要求的结构。 - 统一子节点缩进规则:
validations、attributes下的子元素均保持2个空格递进,确保YAML结构清晰合法。
内容的提问来源于stack exchange,提问作者Minionguyjpro
相关产品推荐
相关产品推荐

