Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Badge request: GitHub actions #2574

Closed
xiaoxiangmoe opened this issue Dec 22, 2018 · 49 comments
Closed

Badge request: GitHub actions #2574

xiaoxiangmoe opened this issue Dec 22, 2018 · 49 comments
Labels
good first issue New contributors, join in! service-badge New or updated service badge

Comments

@xiaoxiangmoe
Copy link

📋 Description

badges for github actions

🔗 Data

Being consulted, this is just an idea. No API available now.

https://developer.github.com/actions/

@chris48s chris48s added service-badge New or updated service badge on-hold Deferred in favor of another approach, blocked on preceding efforts, stale, or abandoned labels Dec 22, 2018
@paulmelnikow
Copy link
Member

Some questions for you:

  1. What's the problem you're wanting to solve?
  2. How do you want to use github actions to solve it?
  3. How would the badge be part of that?

@xiaoxiangmoe
Copy link
Author

xiaoxiangmoe commented Dec 24, 2018

  • Q: What's the problem you're wanting to solve?
    A: Badge for unit test status and coverages in github actions.
  • Q: How do you want to use github actions to solve it?
    A: I'll use github actions as runner for testing.
  • Q: How would the badge be part of that?
    A: Badge will show result of testing.

@devblackops
Copy link

Here is an example: https://github.com/CultureHQ/github-actions-badge

@paulmelnikow paulmelnikow changed the title Badge Request: Badges for github actions Badge request: GitHub actions Jan 25, 2019
@dougnukem
Copy link

@devblackops I'm using the badge from @kddeisz and it works great, they added functionality to link to github action results as well, maybe that can be added to shields.io (right now its a Lambda JS function).

Actions Status

@gr2m
Copy link

gr2m commented May 18, 2019

See also https://github.com/JasonEtco/action-badges @JasonEtco

vintagesucks added a commit to vintagesucks/random-starred-repository that referenced this issue Aug 14, 2019
vintagesucks added a commit to vintagesucks/random-starred-repository that referenced this issue Aug 14, 2019
@smorimoto
Copy link

+1

@chris48s
Copy link
Member

It looks like the other example posted is calling a URL like https://api.github.com/repos/badges/shields/commits/master/check-suites with the header Accept: application/vnd.github.antiope-preview+json, e.g:

curl -H "Accept: application/vnd.github.antiope-preview+json" https://api.github.com/repos/badges/shields/commits/master/check-suites

..and then looking for a check-suite with the name "GitHub Actions". GitHub's docs on this API call say

The API may change without advance notice during the preview period. Preview features are not supported for production use

( see https://developer.github.com/v3/checks/suites/#list-check-suites-for-a-specific-ref )

but tbh, if someone's interested in working on this, I'd be inclined to take a PR for it even though the API is beta at this stage.

@chris48s chris48s added good first issue New contributors, join in! and removed on-hold Deferred in favor of another approach, blocked on preceding efforts, stale, or abandoned labels Aug 18, 2019
@qoomon
Copy link

qoomon commented Aug 19, 2019

FYI official badge api https://github.com/{github_id}/{repository}/workflows/{workflow_name}/badge.svg

@chris48s
Copy link
Member

official badge api

How interesting..

https://github.com/actions/toolkit/workflows/Main%20workflow/badge.svg

Do you have a link to the docs for that, or do you have to be in the actions beta to see them? I'd be interested to read more about this.

@qoomon
Copy link

qoomon commented Aug 19, 2019

Found it at reddit -> https://www.reddit.com/r/github/comments/csehoc/github_actions_official_status_badges/

@calebcartwright
Copy link
Member

I wonder if we went the SvgScraping route if we'd be able to avoid having to use tokens from the pool/hitting the throttling limits 🤔

@khakiout
Copy link

FYI official badge api https://github.com/{github_id}/{repository}/workflows/{workflow_name}/badge.svg

Based on my testing, the workflow should be on the main branch for the badge to be generated. How about you?

@calebcartwright
Copy link
Member

@khakiout - I believe that is true based on what I've seen

@calebcartwright
Copy link
Member

calebcartwright commented Aug 25, 2019

I've opened #3898 and #3913 with two different implementations we could consider using. However, my takeaway from working on these is that any support we may potentially add for GitHub Actions to Shields in the short term would inevitably have some limitations and wouldn't be able to support certain edge cases.

At this moment GH Actions are still pretty new/beta, and there's just not a good official/well documented approach for Shields to get the GH Actions data, so we're stuck using the undocumented/unofficial or indirect approaches.

@calebcartwright
Copy link
Member

calebcartwright commented Aug 25, 2019

Also if anyone is using GitHub Actions in your repos and is willing to test...

Try out your repo/workflow in the staging apps:

@crazy-max
Copy link
Contributor

@calebcartwright Works fine for me on WindowsSpyBlocker 👌

GitHub Actions
GitHub Actions

@vintagesucks
Copy link

@calebcartwright Works fine for me, too. 👍

3898
3913

abatilo added a commit to abatilo/typed-json-dataclass that referenced this issue Sep 30, 2019
@SerafimArts
Copy link

There are doubts that this functionality works as it should. At the moment, all the links on the badge.svg returns 404 for me.

Do you have exactly the same?

@knocte
Copy link

knocte commented Oct 1, 2019

Do you have exactly the same?

It works for me, look at the CI badges in my project: https://github.com/knocte/geewallet

@SerafimArts
Copy link

@knocte Yes, it’s working now. Maybe it was just a temporary problem.

Thx 👍

@sunsheeppoplar
Copy link

Does anyone know whether or not this works on private repos?

@calebcartwright
Copy link
Member

calebcartwright commented Oct 1, 2019

Hi Folks - just a friendly reminder that if you have questions about GitHub's native badge for GitHub Actions/Workflows, you should probably use a different channel to pose those questions. I'd suggest going to one of the GitHub forums to try to get an answer directly from GitHub.

This thread is getting really long, with a lot of non-Shields related comments. Would like to try keep this thread focused on the OT of Shields.io support for GH Actions badges.

Thanks!

@svoop
Copy link

svoop commented Oct 22, 2019

Given the case-sensitive workflow names: It would be nice, if the actions badge implementation accepted an optional query parameter label= to override the name rendered on the badge. This way, you could have consistent badge labels (e.g. all lowercase) and still use different cases (or even names) for the workflows themselves.

(@calebcartwright BTW: When an issue gets OT comments like the ones above, you can hide them by clicking on the "Hide" in the ... menu next to each comment. Hidden comments are only collapsed, those interested can read them anyways.)

@calebcartwright
Copy link
Member

It would be nice, if the actions badge implementation accepted an optional query parameter label= to override the name rendered on the badge

This is supported on all Shields badges, and will also be available for Shields badges for GH Actions

BTW: When an issue gets OT comments like the ones above, you can hide them by clicking on the "Hide" in the ... menu next to each comment. Hidden comments are only collapsed, those interested can read them anyways.

Thanks @svoop, I'm aware of this but deliberately left them as-is since they contain information folks may find useful outside the Shields context.

@svoop

This comment has been minimized.

@calebcartwright

This comment has been minimized.

@svoop
Copy link

svoop commented Nov 20, 2019

@calebcartwright Jeez, me, always one step behind 😄 Thanks for the hint!

@calebcartwright
Copy link
Member

no worries!

@calebcartwright
Copy link
Member

Closed via #3898

@calebcartwright
Copy link
Member

This feature has been implemented is now live! Thanks to @paulmelnikow for getting it shipped so quickly after the PR was merged🎉

Some examples:
https://img.shields.io/github/workflow/status/apache/arrow/Python

And one with all sorts of Shields-customization goodness
https://img.shields.io/github/workflow/status/apache/arrow/Python?color=orange&label=actions&logo=github&logoColor=orange&style=for-the-badge

There's another issue open to track the work for implenting Job-level status badges in #4364 if anyone is interested in tracking that work (or implementing! ❤️)

@PyvesB
Copy link
Member

PyvesB commented Nov 29, 2019

Official Tweet about this new badge: https://twitter.com/Shields_io/status/1200540112368611328

Like and retweet to give us more visibility! 😉

@the-j0k3r
Copy link

the-j0k3r commented Feb 27, 2020

I cant get this to work

https://github.com/bus-stop/x-terminal/workflows/main/badge.svg

Seems all valid and based on format shared?

@paulmelnikow
Copy link
Member

Ah, the name is defined in the YML file; it doesn't come from the name of the YML file.

https://img.shields.io/github/workflow/status/bus-stop/x-terminal/CI
https://github.com/bus-stop/x-terminal/workflows/CI/badge.svg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue New contributors, join in! service-badge New or updated service badge
Projects
None yet
Development

No branches or pull requests