How to query commit status using REST API? #55455
Replies: 1 comment 1 reply
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
I have created a trivial Github Actions workflow:
I have committed it, and it successfully passed on said commit:
I have also triggered the workflow manually and ensured that this case works too.
Now, I am trying to get the summary status of said commit using REST API in Python, but cannot understand how to achieve that.
/repos/{owner}/{repo}/commits/{ref}/statuses
, it simply returns an empty array./repos/{owner}/{repo}/commits/{ref}/status
(singularstatus
, notstatusES
), it surprisingly returns an object with these fields:, which is totally untrue - as we can see from screenshot, the checks have finished.
/repos/{owner}/{repo}/commits/{ref}/check-suites
or/repos/{owner}/{repo}/commits/{ref}/check-runs
, they return multiple results:, with additional entries for workflow runs triggered manually on that commit.
Looking at this SO question, I am not tne only one who can't wrap their hand around
/status
and/statuses
endpoitns.Why doesn't it work? Is there any robust way to query commit whether it's "green" or "red", regardless of what exactly was used to "color" it - GHA or third-party CI system like Circle or Jenkins?
Beta Was this translation helpful? Give feedback.
All reactions