Workflow/actions status badge giving 404 on private repo in an organization #26812
-
I tried to put a GitHub Actions workflow badge ony a private repo, however, it’s always giving me 404
Don’t badges work on private repos? |
Beta Was this translation helpful? Give feedback.
Replies: 16 comments 3 replies
-
Hey @siedlerchr, Thanks for reaching out and for taking the time to submit this report, our engineering team is working on it and I’ll post an update here once I have some news. |
Beta Was this translation helpful? Give feedback.
-
There is no any information about badges works on private repos or not on Docs. And currently it returns 404 |
Beta Was this translation helpful? Give feedback.
-
Try replacing:
With the name of your workflow. Path is only used on workflows that don’t have a name. Sorry that’s confusing. We’ll be adding a button to autogenerate these URLs for you in the near future. |
Beta Was this translation helpful? Give feedback.
-
I tried it today and it works. |
Beta Was this translation helpful? Give feedback.
-
Recently I ran into a similar problem (tried to use the path syntax for a named workflow). But is there a specific reason why we can’t we use the path syntax for a named workflow? Some workflows have names with non-English-based, URL-unfriendly characters, and there are cases where path-based URLs look cleaner. |
Beta Was this translation helpful? Give feedback.
-
I would request to be able to use both name or file path. The name of the workflow might change due to stylistic reasons but the path will most likely (or might) stay the same. |
Beta Was this translation helpful? Give feedback.
-
This solution didn’t work for me, I have a private repository that uses the named workflow:
The badge is being displayed, but it always shows “no status”. |
Beta Was this translation helpful? Give feedback.
-
It takes some time until the badge is generated with the correct value. For me it works now in a private repo |
Beta Was this translation helpful? Give feedback.
-
@siedlerchr works for you by replacing
with the name of the workflow as @mscoutermarsh suggested? Like: |
Beta Was this translation helpful? Give feedback.
-
Doesn’t seem to work for me (displaying badges for a private repo).
Works as long as I open it in a browser that has Github session open. If I open up the above link in the incognito mode, it returns 404 error. I couldn’t find any way to add some authentication / token to that request. Similar issue on SO: github - Getting the status of a badge from a private repository - Stack Overflow. What I want to achieve is to have an internal developer portal app that displays CI status of each app. I could probably integrate it using API, but badges seem to be simple and do what I want. Perhaps they were not designed for such use cases. |
Beta Was this translation helpful? Give feedback.
-
Hi @mscoutermarsh, Not working for me either using the path or name for a private repo. The name URL works where there is a GitHub session, but not in an “incognito window”. Also asked here continuous integration - Does Github support anonymous access to workflow status badges for private repositories? - Stack Overflow. |
Beta Was this translation helpful? Give feedback.
-
Hi! Working well in browser, but, if I use the badge_url from the API inside my html github dashboard, I always get the 404 (using the same browser where github is logged in). It doesn’t make sense. In the HTML I got the 404 icon, but when I click the 404 icon and click “Open image in a new tab” it works as expected. And this only happens for private repos. Can you give some advice? Thanks. |
Beta Was this translation helpful? Give feedback.
-
I too am seeing the same behavior. No matter what I try, no matter what auth headers I use, I cannot download the badge.svg from a private repo. This is an issue, especially for folks who don’t live inside GitHub. We want to take these status badges to display in another dashboard, but we cannot get it working. |
Beta Was this translation helpful? Give feedback.
-
Year later and issue persists... Can we reopen it or something? |
Beta Was this translation helpful? Give feedback.
-
so this is a tremendously cheesy answer, but you can script it with gh and shields.io. could potentially do it at the end of a workflow, but then it'd need to be customised for where it ends up.
|
Beta Was this translation helpful? Give feedback.
-
I'm facing the same 404 issue referencing the badge from a private repo on Github Pages with a custom-generated URL. Problem is the Session Cookie Headers are being ignored/revoked because the source URL is not 'github.com'. 'This attempt to set a cookie via a Set-Cookie header was blocked because it had the "SameSite=Lax" attribute but came from a cross-site response which was not the response to a top-level navigation.' |
Beta Was this translation helpful? Give feedback.
Try replacing:
With the name of your workflow.
Path is only used on workflows that don’t have a name.
Sorry that’s confusing. We’ll be adding a button to autogenerate these URLs for you in the near future.