Note: Issue forms are currently in beta for public repositories on GitHub.com only.
Issue フォームの YAML 構文について
YAML フォーム定義ファイルをリポジトリの/.github/ISSUE_TEMPLATE
フォルダに追加することで、カスタム Issue フォームを作成できます。 YAMLについて詳しくなく、学んでいきたい場合は、「Learn YAML in five minutes (Y分で学ぶYAML)」をお読みください。 Issue フォームにさまざまな入力タイプ、検証、デフォルトのアサインされた人、デフォルトのラベルを定義できます。
コントリビューターが Issue フォームに入力すると、それぞれの入力に対する回答が Markdown に変換され、Issue の本文に追加されます。 コントリビューターは、Issue フォームで作成された問題を編集でき、他のユーザは、他の方法で作成された Issue のように Issue を取り扱うことができます。
Issue forms are not supported for pull requests. You can create pull request templates in your repositories for collaborators to use. 詳細は「リポジトリのプルリクエストテンプレートを作成する」を参照してください。
このサンプル YAML 設定ファイルでは、バグを報告するためにいくつかの入力を使用して Issue フォームを定義します。
name: Bug Report
description: File a bug report
title: "[Bug]: "
labels: ["bug", "triage"]
assignees:
- octocat
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: input
id: contact
attributes:
label: Contact Details
description: さらに情報が必要な場合、どのように連絡すればよいでしょうか?
placeholder: ex. email@example.com
validations:
required: false
- type: textarea
id: what-happened
attributes:
label: What happened?
description: また、生じると期待されていたことは何でしょうか?
placeholder: Tell us what you see!
value: "バグが生じました!"
validations:
required: true
- type: dropdown
id: version
attributes:
label: Version
description: 実行していたソフトウェアのバージョンは?
options:
- 1.0.2 (Default)
- 1.0.3 (Edge)
validations:
required: true
- type: dropdown
id: browsers
attributes:
label: What browsers are you seeing the problem on?
multiple: true
options:
- Firefox
- Chrome
- Safari
- Microsoft Edge
- type: textarea
id: logs
attributes:
label: Relevant log output
description: 関連するログの出力をコピーしてペーストしてください。 これは自動的にコードにフォーマットされるので、バックティックは不要です。
render: shell
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: このIssueをサブミットすることで、あなたは私たちの [行動規範](https://example.com)に同意したことになります。
options:
- label: I agree to follow this project's Code of Conduct
required: true
最上位の構文
すべての Issue フォーム設定ファイルは、name
、description
、body
のキー/値ペアで始まる必要があります。
name:
description:
body:
各 Issue フォームに次の最上位のキーを設定できます。
キー | 説明 | 必須 | 種類 |
---|---|---|---|
name | Issue フォームテンプレートの名前。 Markdown テンプレートを含む他のすべてのテンプレートと異なる、一意の名前である必要があります。 | 必須 | 文字列型 |
説明 | A description for the issue form template, which appears in the template chooser interface. | 必須 | 文字列型 |
body | Definition of the input types in the form. | 必須 | 配列 |
assignees | People who will be automatically assigned to issues created with this template. | 任意 | Array or comma-delimited string |
labels | Labels that will automatically be added to issues created with this template. | 任意 | Array or comma-delimited string |
title | A default title that will be pre-populated in the issue submission form. | 任意 | 文字列型 |
For the available body
input types and their syntaxes, see "Syntax for GitHub's form schema."
Converting a Markdown issue template to a YAML issue form template
You can use both Markdown and YAML issue templates in your repository. If you want to convert a Markdown issue template to a YAML issue form template, you must create a new YAML file to define the issue form. You can manually transpose an existing Markdown issue template to a YAML issue form. 詳しい情報については、「リポジトリ用に Issue テンプレートを設定する」を参照してください。
If you want to use the same file name for your YAML issue form, you must delete the Markdown issue template when you commit the new file to your repository.
An example of a Markdown issue template and a corresponding YAML issue form template are below.
Markdown issue template
---
name: 🐞 Bug
about: File a bug/issue
title: '[BUG] <title>'
labels: Bug, Needs Triage
assignees: ''
---
<!--
Note: Please search to see if an issue already exists for the bug you encountered.
-->
### Current Behavior:
<!-- A concise description of what you're experiencing. -->
### Expected Behavior:
<!-- A concise description of what you expected to happen. -->
### Steps To Reproduce:
<!--
Example: steps to reproduce the behavior:
1. In this environment...
2. With this config...
3. Run '...'
4. See error...
-->
### Environment:
<!--
Example:
- OS: Ubuntu 20.04
- Node: 13.14.0
- npm: 7.6.3
-->
### Anything else:
<!--
Links? リファレンス? Anything that will give us more context about the issue that you are encountering!
-->
YAML issue form template
name: 🐞 Bug
description: File a bug/issue
title: "[BUG] <title>"
labels: [Bug, Needs Triage]
body:
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the bug you encountered.
options:
- label: I have searched the existing issues
required: true
- type: textarea
attributes:
label: Current Behavior
description: A concise description of what you're experiencing.
validations:
required: false
- type: textarea
attributes:
label: Expected Behavior
description: A concise description of what you expected to happen.
validations:
required: false
- type: textarea
attributes:
label: Steps To Reproduce
description: Steps to reproduce the behavior.
placeholder: |
1. In this environment...
2. With this config...
3. Run '...'
4. See error...
validations:
required: false
- type: textarea
attributes:
label: Environment
description: |
examples:
- **OS**: Ubuntu 20.04
- **Node**: 13.14.0
- **npm**: 7.6.3
value: |
- OS:
- Node:
- npm:
render: markdown
validations:
required: false
- type: textarea
attributes:
label: Anything else?
description: |
Links? リファレンス? Anything that will give us more context about the issue you are encountering!
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false