Skip to content

Instantly share code, notes, and snippets.

@reyoung
Created September 3, 2018 04:59
Show Gist options
  • Save reyoung/b5a603038a0063d85ac92ff2672f0283 to your computer and use it in GitHub Desktop.
Save reyoung/b5a603038a0063d85ac92ff2672f0283 to your computer and use it in GitHub Desktop.
#!/bin/bash
BEGIN_PR_ID=11635
END_PR_ID=13159
GH_API_TOKEN=REPLACE_TO_YOUR_API_TOKEN
for ((i=$BEGIN_PR_ID; i<END_PR_ID;++i))
do
curl -H "Authorization: token $GH_API_TOKEN" https://api.github.com/repos/PaddlePaddle/Paddle/pulls/$i > PR.json
merge_sha1=$(cat PR.json | jq -re .merge_commit_sha)
if [[ $? -eq 1 ]]
then
continue
fi
merge_time=$(cat PR.json | jq .merged_at | date -u +%s)
echo ${merge_time}, ${merge_sha1}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment