Commit Status API
Today, we shipped an API for third party services to attach statuses to commits. We created this API to allow services to color the discussion on pull requests. For example,…
Today, we shipped an API for third party services to attach statuses to commits.
We created this API to allow services to color the discussion on pull requests. For example, we use this API internally with our continuous integration (CI) setup to automatically update the status of every commit on every branch. Now, when we discuss pull requests, we can easily and automatically ensure they are safe to merge.
We also designed this API to be flexible. The API allows the service to determine the meaning of whether a commit is successful or not. As a result, the API can be used for just about anything — like design reviews or ensuring contributor license agreements are filed.
Pull Requests
Pull requests show the status of the most recent commit, as well as the (optional) description and URL metadata attached to the status.
Every commit in the pull request features a status indicator.
The merge button for the pull request will also take status into account.
The merge indicator for the pull request takes status into account and offers a warning if the status is not ‘success’. The pull request can still be merged if the status is not successful though – we just warn you about it.
Services Available Today
Travis CI already pushes status information for all Travis-enabled repositories without any additional configuration required. For example, this pull request in Gollum already has statuses attached. See their blog post for more details.
Sprint.ly offers status integration for project management. For enabled repositories, they push status updates when tickets change state. Check out their blog post for the more details.
Using the Commit Status API
Integrating with our Status API is simple. Each status includes a state, a SHA, a repository, and an optional URL and description. The state reflects whether or not a SHA (commit) is successful at that point in time. The states we currently support are “pending”, “success”, “failure”, and “error”. If the status provides a URL or description, we display it in our UI.
Statuses cannot be changed once added to a commit (they’re completely immutable), but any number of statuses may be attached to a single commit. We only display the most recent status for any given commit in our UI.
For more details on the nitty gritty see the API docs.
We are very excited to see what integrations you, the community, develop around this API!
Written by
Related posts
![](https://github.blog/wp-content/uploads/2023/10/Collaboration-DarkMode-2.png?resize=400%2C212)
2024 is the biggest global election year in history. What’s at stake for developers?
GitHub is considering what is at stake for our users and platform, how we can take responsible action to support free and fair elections, and how developers contribute to resilient democratic processes.
![](https://github.blog/wp-content/uploads/2023/10/AI-DarkMode-2.png?resize=400%2C212)
GitHub named a Leader in the Gartner first-ever Magic Quadrant for AI Code Assistants
This year, as part of its annual Magic Quadrant series, Gartner published a first-of-its-kind report analyzing the state of play in the AI Code Assistants market–and named GitHub a Leader.
![AI in software development 2024 survey results with colorful graphics and percentages.](https://github.blog/wp-content/uploads/2024/08/ai-survey-header.png?resize=400%2C212)
Survey: The AI wave continues to grow on software development teams
We surveyed 2,000 people on software development teams at enterprises in the U.S., Brazil, India, and Germany about the use, experience, and expectations around generative AI tools in software development.