mirror of https://github.com/cncf/cncf.io.git
24 lines
548 B
Bash
Executable File
24 lines
548 B
Bash
Executable File
#!/bin/bash
|
|
|
|
project="$1"
|
|
sha="$2"
|
|
comment="$3"
|
|
site_url="$4"
|
|
|
|
token="$(composer config --global github-oauth.github.com)"
|
|
|
|
# Exit immediately on errors
|
|
set -e
|
|
|
|
if [ -n "$site_url" ] ; then
|
|
visit_site="[]($site_url)"
|
|
fi
|
|
|
|
if [ -n "$token" ] ; then
|
|
curl -d '{ "body": "'"$comment\\n\\n$visit_site"'" }' -X POST https://api.github.com/repos/$project/commits/$sha/comments?access_token=$token
|
|
|
|
echo $comment
|
|
echo
|
|
echo $visit_site
|
|
fi
|