ファイルを作成する
リポジトリの/.github/ISSUE_TEMPLATE
フォルダを作成し、この中に任意の名称のyamlファイルを作成します(例. bug_report.yml
)。
内容を記述する
使用できるトップレベルのキーは以下のとおりです。
キー | 説明 | 必須 | 型 |
---|---|---|---|
name | issue formsテンプレートの名前。Markdownテンプレートを含む、他のすべてのテンプレートと異なる一意の名前である必要があります。 | 必須 | 文字列 |
description | テンプレート選択インターフェースに表示される、テンプレートの説明。 | 必須 | 文字列 |
body | フォーム内の入力タイプの定義。 | 必須 | 配列 |
assignees | テンプレートで作成されたIssueに自動的に割り当てられる人。 | 任意 | 配列またはカンマ区切り文字列 |
labels | テンプレートで作成されたIssueに自動的に追加されるラベル。リポジトリに既に存在しないラベルは、Issueに自動的に追加されません。 | 任意 | 配列またはカンマ区切り文字列 |
title | フォームに事前に入力されるデフォルトのタイトル。 | 任意 | 文字列 |
projects | テンプレートで作成された任意のIssueが自動的に追加されるプロジェクト。このキーの形式はPROJECT-OWNER/PROJECT-NUMBERです。注意: Issueを開く人は、指定されたプロジェクトの書き込み権限を持っている必要があります。 | 任意 | 配列またはカンマ区切り文字列 |
GitHub上で/.github/ISSUE_TEMPLATE
内のyamlファイルを編集すると画面右側に使用可能な値についての詳細な説明が表示されます。
上記のように記述すると以下のテンプレート選択時に画像のようなフォームが表示されます。
task.yml
name: Task
description: Use this template for creating tasks related to project development.
assignees:
- P-manBrown
body:
- type: textarea
id: description
attributes:
label: Description
description: Provide a detailed description of the task.
value: |
### What needs to be done?
### Why is this task necessary?
validations:
required: true
- type: textarea
id: acceptance-criteria
attributes:
label: Acceptance Criteria
description: List the requirements that must be met for the task to be considered completed.
value: |
- [ ]
validations:
required: true
- type: textarea
id: additional-information
attributes:
label: Additional Information
description: Include any additional information, links, or references that may be relevant to completing the task.
validations:
required: false
参考