You can slap a badge on your README that shows the status of your Drone CI build.

Here’s how to get it working:

![Build Status](https://drone.io/github/your_username/your_repo/status.png)

That’s it. Seriously. The image URL itself contains all the information Drone needs to know which repository and branch to poll for build status. Drone’s service handles generating the badge dynamically.

This works because Drone exposes a public API endpoint that serves an SVG image. The URL structure is https://drone.io/<provider>/<owner>/<repo>/status.png. When a browser or Markdown renderer requests this URL, Drone checks its internal state for the latest build of the default branch for that repository. It then renders a small PNG image indicating success, failure, or pending status.

Let’s break down the components of that URL:

  • https://drone.io: This is the base URL for the Drone CI status image service.
  • /github/: This specifies the version control provider. Drone supports github, gitlab, and bitbucket. You’d change this part if your repository is hosted elsewhere.
  • your_username: This is your username or organization name on the specified provider.
  • your_repo: This is the name of your repository.
  • /status.png: This is the specific endpoint that provides the build status image.

So, if you had a GitLab repository named my-awesome-project under the organization my-org, the badge URL would look like this:

![Build Status](https://drone.io/gitlab/my-org/my-awesome-project/status.png)

For a Bitbucket repository named data-cruncher owned by the user devops_guru:

![Build Status](https://drone.io/bitbucket/devops_guru/data-cruncher/status.png)

The badge automatically reflects the status of the default branch. If you want to show the status of a specific branch, you can append /branch/<branch_name> to the URL. For example, to show the status of the develop branch:

![Build Status](https://drone.io/github/your_username/your_repo/status.png?branch=develop)

Or, if you’re using the more modern approach of specifying the branch directly in the path for specific branches:

![Build Status](https://drone.io/github/your_username/your_repo/status.png/branch/develop)

(Note: The exact path for branch-specific badges can vary slightly with Drone versions and configurations. The query parameter ?branch=develop is generally more robust across different Drone setups).

The badge will cycle through different states:

  • Grey: Build is pending or no build has run yet.
  • Green: The latest build on the default branch succeeded.
  • Red: The latest build on the default branch failed.

This provides an immediate, visual indicator to anyone looking at your README about the health of your project’s continuous integration pipeline. It’s a simple but effective way to signal code quality and stability.

Many people assume the badge URL is a static image that gets updated. It’s not. It’s a dynamic endpoint that queries the Drone API in real-time. The URL itself is constant, but the image it serves changes based on the current build status. This means you only need to set it up once, and it will always reflect the latest state of your CI. The service is designed to be highly available and efficient, serving millions of badge requests daily without impacting your Drone server’s performance.

The next step is to integrate this into your deployment pipeline to ensure the badge accurately reflects successful deployments.

Want structured learning?

Take the full Drone course →