Question
How would one get the build status of Travis CI of a particular GitHub commit from the of any arbitrary open source project?
Example
For example, how would an arbitrary GitHub user (with a Travis account) query the passing/failed build status of this build based on the following information:
- username:
a-t-0
- repository:
Code-LatexReportTemplate
- branch:
main
- Commit:
2758dc700dfaa9726f0e1755753347b4d450acda
Attempts
To get the status of that commit I tried:
- A get command:
GET /repos/a-t-0/Code-LatexReportTemplate/commits/2758dc700dfaa9726f0e1755753347b4d450acda/status
Which returns nothing.
- A curl command:
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/a-t-0/Code-LatexReportTemplate/commits/2758dc700dfaa9726f0e1755753347b4d450acda/status
Which returns a lot of information, but an empty statuses information as shown in the selected output below:
"state": "pending",
"statuses": [
],
This empty statuses information seems to be contradictory to the green checkflag on that commit, which shows the build on that commit is passed.
You can use the check-run api using Github API rest v3 like this
Example: https://api.github.com/repos/a-t-0/Code-LatexReportTemplate/commits/2758dc700dfaa9726f0e1755753347b4d450acda/check-runs
and for check-suites :
Example: https://api.github.com/repos/a-t-0/Code-LatexReportTemplate/commits/2758dc700dfaa9726f0e1755753347b4d450acda/check-suites
Using graphql API, you can use
statusCheckRollup
field :which returns :
Checkout statuscheckrollupcontext and checkrun