gh コマンドを利用した GitHub の project id の確認方法
GitHub の project id の取得方法を直ぐに見つけられなかったのでメモです。
gh api repos/<organization name>/<repository name>/projects
こちらのコマンドを実行すれば、そのレポジトリに紐づいたプロジェクト id の一覧を取得できます。
rails レポジトリでのコマンド実行例
- project の id は、12425773 だとわかります。
$ gh api repos/rails/rails/projects
[
{
"owner_url": "https://api.github.com/repos/rails/rails",
"url": "https://api.github.com/projects/12425773",
"html_url": "https://github.com/rails/rails/projects/2",
"columns_url": "https://api.github.com/projects/12425773/columns",
"id": 12425773,
"node_id": "MDc6UHJvamVjdDEyNDI1Nzcz",
"name": "Issues Triage Board",
"body": "A project board for triaging issues in Rails",
"number": 2,
"state": "open",
"creator": {
"login": "eileencodes",
"id": 1080678,
"node_id": "MDQ6VXNlcjEwODA2Nzg=",
"avatar_url": "https://avatars.githubusercontent.com/u/1080678?u=b6e211b7766e6aa01e794067f67dd65d419c0150&v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/eileencodes",
"html_url": "https://github.com/eileencodes",
"followers_url": "https://api.github.com/users/eileencodes/followers",
"following_url": "https://api.github.com/users/eileencodes/following{/other_user}",
"gists_url": "https://api.github.com/users/eileencodes/gists{/gist_id}",
"starred_url": "https://api.github.com/users/eileencodes/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/eileencodes/subscriptions",
"organizations_url": "https://api.github.com/users/eileencodes/orgs",
"repos_url": "https://api.github.com/users/eileencodes/repos",
"events_url": "https://api.github.com/users/eileencodes/events{/privacy}",
"received_events_url": "https://api.github.com/users/eileencodes/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2021-05-10T13:07:37Z",
"updated_at": "2021-05-10T13:10:36Z"
},