[solved] Drone build badge is not updating

it keeps showing none even though I have succeeded and failed builds …

only works on default branch push ?

The following url displays the last build for the default branch:

http://{host}/api/badges/{owner}/{name}/status.svg

The following url displays the last build for the specified branch:

http://{host}/api/badges/{owner}/{name}/status.svg?branch={branch}

You can review the logic at https://github.com/drone/drone/blob/master/server/badge.go#L22

Note that the badge does not include pull requests, which is by design. The reason is that the badge represents the status of your repository / branch. The pull request has not been merged yet, and is therefore not reflective of the actual state of your branch.

2 Likes

Our company is on one of the latest 1.0 RCs, don’t know if its the last or not.

When using the UI to get the badge for a branch, it provides a ?ref=refs/heads/<branch which when looking at the code seems to be the same outcome as the one you suggested above.

The problem we face, with either URL option, is that we always get a none build status, even though the last build for that branch actually passed.

What could be wrong?

We must be in RC5.

The solution, Drone build badge in 1.0.0rc5

FYI, we upgraded to RC6 and the UI still generates the badge links with the initial forward slash.