comment.sh 297 B

12345678910111213141516171819
  1. #!/bin/bash
  2. PR=$1
  3. MSG=$2
  4. if [ -z "$PR" ]; then
  5. echo "Usage: $0 <pr_number> <msg>"
  6. exit 1
  7. fi
  8. shift
  9. for msg in "$@"
  10. do
  11. echo Comment: $msg
  12. hub api repos/{owner}/{repo}/issues/$PR/comments -f "body=$msg" > /dev/null
  13. if [ "$?" -eq "0" ]; then
  14. echo "Success!"
  15. fi
  16. done