Files
cloudpods/scripts/comment.sh
2019-07-30 16:20:49 +08:00

20 lines
297 B
Bash
Executable File

#!/bin/bash
PR=$1
MSG=$2
if [ -z "$PR" ]; then
echo "Usage: $0 <pr_number> <msg>"
exit 1
fi
shift
for msg in "$@"
do
echo Comment: $msg
hub api repos/{owner}/{repo}/issues/$PR/comments -f "body=$msg" > /dev/null
if [ "$?" -eq "0" ]; then
echo "Success!"
fi
done