0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【GitHub】issue formsを作成する方法

Last updated at Posted at 2024-07-11

ファイルを作成する

リポジトリの/.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ファイルを編集すると画面右側に使用可能な値についての詳細な説明が表示されます。

スクリーンショット 2024-07-12 0.05.40.png

上記のように記述すると以下のテンプレート選択時に画像のようなフォームが表示されます。

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

スクリーンショット 2024-07-12 0.09.17.png

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?