Article Badge Counter (ABC) Workflow

Estee Tey - Dec 3 '21 - - Dev Community

Submission Category: Wacky Wildcards


Link to Code

Main repository

GitHub logo lyqht / article-badge-counter-workflow

GitHub Action Workflow that complements blog-post-workflow to generate a Shields.io badge. Intended to be easy like ABC

article-count-workflow

This GitHub action workflow aims to help you to create an article badge counter like this to showcase on your profile that you are more than just a developer 😉 Users can click it and be redirected to a website of your choice.

The default badge looks something like this.

Website

What it does

This workflow is a composite action:

  • The number of articles is retrieved using the blog-post-workflow action.
  • The badge is generated using Shields.io, which are not clickable by default.
  • This action has a script to take in your inputs to create a customized clickable badge.
  • The commit and push github actions to your repo are performed by the git-auto-commit workflow

How to use

If you are new to GitHub Actions, refer to this section. Otherwise, you can get started by referring to to the example given and the input options available.

Example

This is an example…

Also tried out doing a pre-release on the GitHub Action Marketplace here


About the workflow

This workflow is a composite action:

  • The number of articles is retrieved using the blog-post-workflow action.
  • The badge is generated with Shields.io, which is not clickable by default.
  • This action has a script to take in your inputs to create a customized clickable badge.
  • The commit and push github actions to your repo are performed by the git-auto-commit workflow

Using the GitHub Action

An example for the action yaml, instructions for those who are unfamiliar with GitHub Actions, and the input options available to be used to customize the badge are included in the repository's README.md.

Users can display their generated badge on their GitHub profile README.md in any way they like. This is a layout example from my profile.

GitHub Profile with generated article badge counter

Additional Resources / Info

Special thanks to Gautam Krishnar for helping to fix the bug that I discovered while working on this action 🧡 He also submitted the blog-post-workflow action for the hackathon, and the article can be found here.


Room for improvements

There were a lot of troubleshooting along the way, but it was fun to learn about composite action concepts and create this action 😄 Ideally, I would also want to include some form of E2E test on the README as part of the composite action to make sure that the badge does render correctly before the action pushes the commit.

. . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player