コンテンツにスキップ

Issues

この章では、GitHub Issuesの作成・管理方法、テンプレートの設定、ラベル・マイルストーンの活用を学びます。

Issuesは、タスク、バグ、機能要望などを追跡・管理するための機能です。

  • バグ報告: 不具合の報告と追跡
  • 機能要望: 新機能のリクエスト
  • タスク管理: やるべきことの記録
  • ディスカッション: 設計や方針の議論
  • ドキュメント: 技術的な決定の記録
  1. リポジトリの「Issues」タブ
  2. 「New issue」ボタン
  3. タイトルと本文を入力
  4. 「Submit new issue」
## 概要
問題や要望の簡潔な説明
## 現在の動作(バグの場合)
- 何が起きているか
- エラーメッセージ
## 期待する動作
- どうあるべきか
## 再現手順(バグの場合)
1. ○○を開く
2. ○○をクリック
3. ○○を入力
## 環境
- OS: macOS 14.0
- ブラウザ: Chrome 120
- バージョン: v1.2.3
## スクリーンショット
(必要に応じて)
.github/
├── ISSUE_TEMPLATE/
│ ├── bug_report.md
│ ├── feature_request.md
│ └── config.yml
---
name: バグ報告
about: 不具合の報告
title: '[Bug] '
labels: bug
assignees: ''
---
## バグの概要
<!-- 何が問題か簡潔に説明 -->
## 再現手順
1.
2.
3.
## 期待する動作
<!-- どう動くべきか -->
## 実際の動作
<!-- 何が起きたか -->
## 環境
- OS:
- ブラウザ:
- バージョン:
## スクリーンショット
<!-- 該当する場合は添付 -->
## 追加情報
<!-- その他の関連情報 -->
---
name: 機能要望
about: 新機能のリクエスト
title: '[Feature] '
labels: enhancement
assignees: ''
---
## 概要
<!-- 追加したい機能の説明 -->
## 背景・動機
<!-- なぜこの機能が必要か -->
## 提案する解決策
<!-- どのように実現するか -->
## 代替案
<!-- 検討した他の方法 -->
## 追加情報
<!-- モックアップ、参考リンクなど -->
.github/ISSUE_TEMPLATE/config.yml
blank_issues_enabled: false # 空のIssueを無効化
contact_links:
- name: 質問・相談
url: https://github.com/user/repo/discussions
about: 質問はDiscussionsをご利用ください
- name: セキュリティ問題
url: https://github.com/user/repo/security/policy
about: セキュリティ問題は非公開で報告してください

より構造化された入力フォームを作成できます。

.github/ISSUE_TEMPLATE/bug_report.yml
name: バグ報告
description: 不具合を報告する
title: "[Bug]: "
labels: ["bug", "triage"]
body:
- type: markdown
attributes:
value: |
バグ報告ありがとうございます。
以下の項目をできるだけ詳しく記入してください。
- type: textarea
id: description
attributes:
label: バグの説明
description: 何が問題か説明してください
placeholder: ログインボタンをクリックしても反応がない
validations:
required: true
- type: textarea
id: steps
attributes:
label: 再現手順
description: バグを再現する手順
placeholder: |
1. '...' に移動
2. '...' をクリック
3. '...' までスクロール
4. エラーが発生
validations:
required: true
- type: dropdown
id: browsers
attributes:
label: ブラウザ
description: 使用しているブラウザ
options:
- Chrome
- Firefox
- Safari
- Edge
- その他
validations:
required: true
- type: input
id: version
attributes:
label: バージョン
description: 使用しているバージョン
placeholder: v1.2.3
validations:
required: false
- type: checkboxes
id: terms
attributes:
label: 確認事項
options:
- label: 既存のIssueを検索しました
required: true
- label: 最新バージョンで確認しました
required: false
ラベル説明
bugバグ報告
documentationドキュメント
duplicate重複
enhancement機能追加
good first issue初心者向け
help wanted助けを求める
invalid無効
question質問
wontfix対応しない

Issues → Labels → New label:

おすすめのカスタムラベル:
- priority/high, priority/medium, priority/low(優先度)
- status/in-progress, status/blocked(状態)
- type/bug, type/feature, type/chore(種類)
- area/frontend, area/backend, area/infra(領域)
Terminal window
# GitHub CLI
gh label create "priority/high" --color "d73a4a" --description "高優先度"
gh label create "priority/medium" --color "fbca04" --description "中優先度"
gh label create "priority/low" --color "0e8a16" --description "低優先度"
# ラベル一覧
gh label list
# ラベル削除
gh label delete "wontfix"

リリースや期限に向けたIssueのグループ化機能です。

  1. Issues → Milestones → New milestone
  2. タイトル、説明、期限を設定
  3. Create milestone
マイルストーン例:
- v1.0.0 リリース
- 2024年Q1
- Sprint 1
- MVP

Issue作成時またはサイドバーでマイルストーンを選択。

Milestones ページで:

  • Open/Closed の割合
  • 完了率(%)
  • 期限までの残り日数
  • Issue作成時にサイドバーで選択
  • 複数人のアサインも可能
  • 自分にアサイン: サイドバーで「assign yourself」
.github/workflows/auto-assign.yml
name: Auto Assign
on:
issues:
types: [opened]
jobs:
assign:
runs-on: ubuntu-latest
steps:
- uses: pozil/auto-assign-issue@v1
with:
assignees: username1,username2
numOfAssignee: 1
# 同じリポジトリ
#123
See #123
# 別のリポジトリ
owner/repo#123
# コミットへの参照
abc1234

PRで以下のキーワードを使用:

Closes #123
Fixes #123
Resolves #123
## 関連タスク
- [ ] #123 認証機能
- [x] #124 ログイン画面(完了)
- [ ] #125 ログアウト機能

# 自分にアサインされたIssue
is:issue is:open assignee:@me
# 特定のラベル
is:issue label:bug label:priority/high
# マイルストーン
is:issue milestone:"v1.0.0"
# 作成日
is:issue created:>2024-01-01
# 複合検索
is:issue is:open label:bug assignee:@me sort:created-desc
Terminal window
# Issue一覧
gh issue list
# Issue作成
gh issue create --title "タイトル" --body "本文" --label "bug"
# Issue詳細
gh issue view 123
# Issueを閉じる
gh issue close 123
# Issueを再オープン
gh issue reopen 123

重要なIssueを最上部に固定:

  1. Issue を開く
  2. 右サイドバー → 「Pin issue」

最大3つまでピン留め可能。


機能用途
テンプレート統一フォーマットで報告
フォーム構造化された入力
ラベル分類・フィルタリング
マイルストーンリリース計画
アサイン担当者の明確化

次の章では、GitHub Projectsについて学びます。

Q1. GitHub Issuesの主な用途として正しいものはどれですか?

Q2. Issueテンプレートを配置するディレクトリはどれですか?

Q3. Issueのマイルストーンの主な用途は何ですか?