GitHub Actions badge "Not Found"

I get “Not Found” from URLs I thought would show a build status badge after following the docs here: https://help.github.com/en/articles/configuring-a-workflow#adding-a-workflow-status-badge-to-your-repository. I have a YAML file with the workflow name “Build” here: https://github.com/kikuchipy/kikuchipy/blob/master/.github/workflows/build.yml. The URLs I thought would show the workflow status, https://github.com/kikuchipy/kikuchipy/workflows/Build/badge.svg or https://github.com/kikuchipy/kikuchipy/workflows/.github/workflows/build.yml/badge.svg, both return “Not Found”.

Does it take some time for the URLs to return the badge? Or am I doing something wrong?

1 Like

I have the same problem

@hwagit Remove the duplicate <OWNER> name: 

https://github.com/kikuchipy/workflows/Build/badge.svg

whereas you have…

https://github.com/kikuchipy/kikuchipy/...

I can confirm the badges do work. 

@rameneI’m not sure I understand you, I have an organization named KikuchiPy with a repo named KikuchiPy, thus the two kikuchipy’s.

Also, I’m not saying the badges don’t work, I’m saying mine don’t work. Or are you saying mine works?

Thanks for reporting this - it definitely looks like a bug.  We’ll investigate.

3 Likes

@codingcrush what’s the repository and workflow where you’re not seeing the badge displayed?

Same issue here : the badge is “404 Not Found” for all my projects using GitHub Actions.
It doesn’t matter if I use the workflow name or its file path.
Some examples:

cedx/lcov.js
https://github.com/cedx/lcov.js/workflows/Continuous%20integration/badge.svg
https://github.com/cedx/lcov.js/workflows/.github/workflows/ci.yaml/badge.svg

cedx/phpunit-expect

https://github.com/cedx/phpunit-expect/workflows/Continuous%20integration/badge.svg

https://github.com/cedx/phpunit-expect/workflows/.github/workflows/ci.yaml/badge.svg

cedx/where.dart

https://github.com/cedx/where.dart/workflows/Continuous%20integration/badge.svg
https://github.com/cedx/where.dart/workflows/.github/workflows/ci.yaml/badge.svg

Sorry you are seeing that. Currently the badge looks for a run passing on the “master” branch. It looks like your workflow runs are on the “develop” branch.

We are looking at letting users specify the branch in the URL so that this use case will work and we’ll update the docs to make that clearer.

My runs pass on the “develop” and “master” branches… but strangely, “master” runs are categorized as “develop”.
It’s probably due to the fact that I use “git rebase” on the “master” branch (so the commit SHA are the same as the “develop” branch).

EDIT: I’ve tried a “git merge” on one of my projects, and it works :slight_smile: The badge is OK, and the run is correctly associated with the “master” branch… but I would like to avoid merging when I can.

1 Like

The badge doesn’t seem to work with my workflow. I am running tests only on PRs. So far, pushing to a branch and then opening a PR launches the tests, but no badge appears after merging the changes.

Important:

- The filename is not important

- The Yaml name is the one used

- Name are case senstive! so make sure URL is exactly the casing as ur repo name and workflow name

the badges works fine but you have to have the correct name of the workflow set as the badge name: 

for example 

the yaml file name is main.yml

content must be 

name: main

on:
push:
branches:
-'\*'  
-'!\*/\*'  
tags: []
pull\_request:

and link will be  

https://github.com/{{ repo owner }}/{{ repo name }}/workflows/{{ workflow name as in the yaml file and name }}/badge.svg
4 Likes

Thanks.

It works.

But the yaml file name have not to be similar with name: value inside of this file.

Only name: value and workflow name have to be similar.

github actions badge dosen’t work inside a gist.

https://gist.github.com/xgirma/371da4a5e936a3505d77f72f1787927c