Created
April 6, 2016 18:46
-
-
Save DanPurdy/842dea0f0342afbdb426289df3c7c14a to your computer and use it in GitHub Desktop.
Checks your eslint output (checkstyle formatted) for errors and reports the status back to github via the status API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## check for eslint errors. | |
if (grep -c 'severity=\"error\"' test-reports/*.xml 1> /dev/null 2>&1) then | |
curl -H "Authorization: token <YOUR-GITHUB-TOKEN-HERE>" \ | |
--request POST \ | |
--data \ | |
'{ | |
"state": "failure", | |
"context": "ESLint", | |
"description": "Lint errors present", | |
"target_url": "${bamboo.buildResultsUrl}" | |
}' \ | |
https://GITHUB-URL/api/v3/repos/GITHUB-USER/REPO/statuses/${bamboo.repository.revision.number} > /dev/null | |
else | |
curl -H "Authorization: token <YOUR-GITHUB-TOKEN-HERE>" \ | |
--request POST \ | |
--data \ | |
'{ | |
"state": "success", | |
"context": "ESLint", | |
"description": "Linted successfully", | |
"target_url": "${bamboo.buildResultsUrl}" | |
}' \ | |
https://GITHUB-URL/api/v3/repos/GITHUB-USER/REPO/statuses/${bamboo.repository.revision.number} > /dev/null | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment