I have created an Xcode Bot that integrates on each commit.
In the "Run Script" Trigger I would like to update the current GitHub commit with the integration status of Tests that were run. Pretty standard CI stuff.
I'll then be running a script like the below:
curl -i -X POST -H "Content-type: application/json"
-H 'Authorization: token TOKEN_HERE' -d
'{
"state": "success",
"target_url": "https://example.com/build/status",
"description": "The build succeeded!",
"context": "continuous-integration/jenkins"
}'
https://api.github.com/repos/ORGANIZATION_HERE/REPO_HERE/statuses/SHA_HERE
It looks like I'll be able to get the success
or failure
states from the Xcode Bot Environment variables:
Access build folder in Xcode Server CI bot run (env variables?)
However, the SHA of the current commit is not listed. How am I able to get the SHA of the commit used for the Integration at this point, to be used in the GitHub Status API request?