How to access GitHub action output in a badge

Viewed 490
3 Answers

There are few options in Github actions marketplace

Bring Your Own Badge - https://github.com/marketplace/actions/bring-your-own-badge

BYOB is a GitHub Action to create badges dynamically based off of GitHub Actions' results, allowing for extremely versatile and easily-maintainable badges.

If you want to use https://shields.io/, consider Dynamic Badges - https://github.com/marketplace/actions/dynamic-badges

This action allows you to create badges for your README.md with shields.io which may change with every commit. To do this, this action does not need to push anything to your repository!

In a subsequent job (step) in the same workflow you could. I think you want to use your own badge using e.g. https://img.shields.io. I image you will update e.g. the README file every time the actions are finished, the updating step will be part of the workflow. The transfer of output could be done like here Using output from a previous job in a new one in a GitHub Action.

You will append e.g. the README with a proper svg [![](https://img.shields.io/badge/TEXT-NUMBER-COLOR?style=flat)](some url).

I created an action to generate a badge from a workflow:

Build-A-Badge - https://github.com/marketplace/actions/build-a-badge

As other users have pointed out, I didn't want any external dependencies or to create new branches on the main repo. So the workaround I used is to store the badge data in the Wiki, which is a separate repository.

Related