Skip to content

Instantly share code, notes, and snippets.

@shapeshed
Created July 4, 2014 12:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shapeshed/90a8d7851642cd5e0ffc to your computer and use it in GitHub Desktop.
Save shapeshed/90a8d7851642cd5e0ffc to your computer and use it in GitHub Desktop.
Post Coverage from TC to Github Pull Requests
#!/usr/bin/env sh
ISSUE=`echo %teamcity.build.branch% | cut -d '/' -f 1`
COVERAGE=`cat coverage/PhantomJS\ 1.9.7\ \(Linux\)/index.html | grep "Lines: <span class=\"metric\">" | awk -F ">" '{print $2}' | cut -d "<" -f1`
curl -X POST -H "Content-Type: application/json" -d "{\"body\": \"I am coveragebot! LOC code coverage is now $COVERAGE\"}" -u [mykey]:x-oauth-basic https://api.github.com/repos/BedeGaming/BingoV3/issues/$ISSUE/comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment