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

Storing badge under the GitHub Action #41

Open
baubakg opened this issue Apr 12, 2021 · 2 comments
Open

Storing badge under the GitHub Action #41

baubakg opened this issue Apr 12, 2021 · 2 comments

Comments

@baubakg
Copy link

baubakg commented Apr 12, 2021

Hi,

I would like to avoid storing badges in my repository code. Ideally I would like to store my badges un der the GitHub Action execution itself. This way I can reference it in the markdown.

<Path to my Repository>/actions/workflows/myGitHubActionFile.yml/jacoco.svg

Is there a workaround for this?

@antonagestam
Copy link
Contributor

@baubakg If a simple green/red badge is what you're after, then the builtin Github Actions badges should work: https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/adding-a-workflow-status-badge

Otherwise, if you want a badge with "burnt-in" coverage percentage, things are more complicated. I've had the idea of storing rendered badges in artifacts, but that doesn't work (at least trivially) because there's no predictable way to link to the latest artifacts of a workflow. You'd also have to deal with the problem of artifact retention.

So I think currently there's no straight-forward way to achieve this without involving a third-party host to associate coverage percentage with a branch/commit-ish.

@leherv
Copy link

leherv commented Dec 29, 2022

I think a convenient way would be to provide output variables which then can be picked up by another action to create a gist which then can be used to create a badge. This would be the most flexible and least "intrusive" way imho.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants