Created
November 20, 2017 14:42
-
-
Save turusuke/dd4be13b20b2bfb8ea5dece18d56bb2e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# Usage ./get-pr-review.sh :number(ex.120) | |
# dependencies jq -> https://stedolan.github.io/jq/ | |
# { | |
# "user": "turusuke", | |
# "filePath": "main.js:14", | |
# "body": "いいと思います!", | |
# "arg": "https://github.com/owner/repo/pull/540#discussion_11111" | |
# } | |
# TOKENKEY TEXT FILE | |
# https://github.com/settings/tokens/new -> repo | |
apikey=`cat ~/apikey.txt` | |
# Request URL | |
url=https://github.com/api/v3/repos/:owner/:repo/pulls/$1/comments\?access_token\=$apikey | |
# Object | |
object='[.[] | {user: .user.login ,filePath: "\(.path):\(.position)", body: .body, arg: ._links.html.href}]' | |
# 実行 | |
curl -s $url | jq $object |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment