API에서 GiitHub의 issues 가져오기

960 단어 GitHubJSONfishtech
가끔 쓰지만 알아볼게요.
TOKYEN 이용Personal access tokens 발매.(public 필요 없는 Repository)
권한repo에 검사가 있으면 됩니다.
# 以下は fish の場合で、 bash だと TOKEN=xxx みたいな書き方になる
# 参考: [fish set](http://fishshell.com/docs/current/cmds/set.html?highlight=set)
set TOKEN {your personal access token}
set USER_NAME {your name}
set REPO_NAME {your repository name}

# issue 全件を json で取得
curl -H "Authorization: token $TOKEN" https://api.github.com/repos/$USER_NAME/$REPO_NAME/issues

# 絞り込み(例はラベル名 `bug` で絞り込み)
curl -G --data-urlencode "labels=bug" -H "Authorization: token $TOKEN" https://api.github.com/repos/$USER_NAME/$REPO_NAME/issues

# issue から title と url だけを csv に変換
curl -H "Authorization: token $TOKEN" https://api.github.com/repos/$USER_NAME/$REPO_NAME/issues | jq -r '.[] | [.title, .url] | @csv'

좋은 웹페이지 즐겨찾기