LoginSignup
3
0

More than 5 years have passed since last update.

Github API から team_id を取得するワンライナー(jq 利用)

Last updated at Posted at 2017-02-28

たまに、organization に属しているチームの team_id を取得したいんだけど、いつも調べるのに手間がかかるから書いておきます。

jq が必要です。

コマンド

GITHUB_TOKEN: Githubのトークン
ORG_NAME: Organization名
TEAM_NAME: チーム名

をそれぞれを入れる必要あり。

curl -s -H "Authorization: token GITHUB_TOKEN" "https://api.github.com/orgs/ORG_NAME/teams?per_page=100" | jq '.[] | select(.slug == "TEAM_NAME") | .id'

上記で team_id だけ取れる。

3
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
3
0