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 3 years have passed since last update.

GitHubの公式CLIを使ってissueをまとめて作成する

Posted at

普段私達の開発チームはGitHubのProjectsを使ってissue(タスク)管理しています。
今回、一括でissueを登録する必要があり、ブラウザからポチポチやるのが手間だったので公式CLIを使ってみました。

投稿するまでもない内容ですが、また公式ドキュメント見るのも手間なのでメモレベルで投稿します。

インストールする(Mac)

$ brew install gh

ログインする

ドキュメント
https://cli.github.com/manual/

$ gh auth login

# あとは案内に従ってログイン

issueを作成する

公式のドキュメントを見ると使い方は下記の通りのようです。
https://cli.github.com/manual/gh_issue_create

$ gh issue create --title "I found a bug" --body "Nothing works"
$ gh issue create --label "bug,help wanted"
$ gh issue create --label bug --label "help wanted"
$ gh issue create --assignee monalisa,hubot
$ gh issue create --project "Roadmap"

※ GitHub上の対象プロジェクトは .git/config の中身を見ているっぽいです(未確認)

とりあえず適当にシェルファイルを作成する

$ vim ./github.sh

ファイルの中身はこんな感じです。

github.sh
gh issue create --title "ここにissueタイトルがはいります。その1" --body "
ダブルクォーテーションで囲めばbodyに
改行が使えます。
" --project 日本語でもプロジェクト名がはいります

gh issue create --title "ここにissueタイトルがはいります。その2" --body "
ダブルクォーテーションで囲めばbodyに
改行が使えます。
" --project 日本語でもプロジェクト名がはいります

そのシェルファイルを実行します

$ sh github.sh

これで完了です。

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?