Skip to content

Commit

Permalink
Modified spelling script to stop vescodebot commenting on spelling mi…
Browse files Browse the repository at this point in the history
…stakes as well as plumedbot
  • Loading branch information
gtribello committed Aug 6, 2019
1 parent 22db3a0 commit b749a16
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions user-doc/go-spelling
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,21 @@ if [ ! -f spelling_results ] ; then
exit 0
fi

GIT_OWNER=$( echo $TRAVIS_REPO_SLUG | sed "s/\/.*$//" )

if test -z $TRAVIS ; then
awk '{for(i=1;i<=NF;++i){ if($i=="\\n") {printf("\n"); } else {printf("%s ", $i)} }}' spelling_results
# If not a pull request add a comment on the commit message
elif [ $TRAVIS_PULL_REQUEST=="false" ] ; then
ASPELL_RESULTS=`cat spelling_results`
curl -i -H "Authorization: token $GIT_TOKEN" \
-H "Content-Type: application/json" \
-X POST -d "{\"body\":\"$ASPELL_RESULTS\"}" \
https://api.github.com/repos/plumed/plumed2/commits/$TRAVIS_COMMIT/comments
if [ "$GIT_OWNER" = plumed ] ; then
ASPELL_RESULTS=`cat spelling_results`
curl -i -H "Authorization: token $GIT_TOKEN" \
-H "Content-Type: application/json" \
-X POST -d "{\"body\":\"$ASPELL_RESULTS\"}" \
https://api.github.com/repos/plumed/plumed2/commits/$TRAVIS_COMMIT/comments
fi
# If it is a pull request comment on the pull request
else
elif [ "$GIT_OWNER" = plumed ] ; then
ASPELL_RESULTS=`cat spelling_results`
curl -i -H "Authorization: token $GIT_TOKEN" \
-H "Content-Type: application/json" \
Expand Down

0 comments on commit b749a16

Please sign in to comment.