Created
August 6, 2020 00:28
-
-
Save Gowiem/4c6fd3e2a60b922fe9f0627016d01fdc to your computer and use it in GitHub Desktop.
This file contains hidden or 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/bash | |
GITHUB_USERNAME=Gowiem | |
MINS_AGO=$(date -v-30M -u +"%Y-%m-%dT%H:%M:%SZ") | |
PRS_CREATED_RECENTLY=$(curl -u $GITHUB_USERNAME:$GITHUB_API_TOKEN \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
"https://api.github.com/issues?since=$MINS_AGO&per_page=100") | |
PR_URLS=($(echo $PRS_CREATED_RECENTLY | jq -r ".[].pull_request.url | @sh")) | |
for i in "${PR_URLS[@]}"; do | |
url=$(echo "$i" | sed "s/pulls/issues/g" | sed "s/'$/\/comments/" | sed "s/'//g") | |
echo "URL: $url" | |
curl \ | |
-X POST \ | |
-u $GITHUB_USERNAME:$GITHUB_API_TOKEN \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
$url \ | |
-d '{"body":"/test all"}' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment