DEV Community

Discussion on: Article Badge Counter (ABC) Workflow

Collapse
 
cicirello profile image
Vincent A. Cicirello

Very nice. If I ever get around to starting a blog I might use a variation of this. Have you thought about having it instead generate a Shields JSON file specifying the badge, and pushing that instead of the badge? The benefit is that the README wouldn't need to change when the badge content changes. I have an action that counts the number of workflows that use an action and reports the count with a badge, and instead of generating the badge my action generates JSON in format expected by Shields, so the markdown in README to insert badge and link it to something stays the same. If you want to see what I mean, check out github.com/cicirello/count-action-.... If you do something similar, you just need to update the post count in a JSON file when it changes and existing markdown in README stays the same. Anyway, nice workflow.

Collapse
 
lyqht profile image
Estee Tey

That's a great idea! that way, the user don't need to include the comment tag name for the action to search for where they want to put the badge, users just have to point the image url to where the generated JSON file will be.

I did consider that approach initially, however decided not to do it because of 2 user experience reasons.

  1. I didn't really want to create additional files in the user's repository, so i rather the workflow update the README rather than generating a new JSON file and updating it.
  2. I would also expect that if anyone uses them, a lot will people who already uses blog-post-workflow, so I wanted to keep the inputs consistent with that workflow.

I also find the Shields endpoint a little too complicated to understand, that's why in this action I'm just creating CDN links rather than generating endpoints.

I did check out your project though, really liked that you have a Dockerfile and also tests. 😄