Creating a GitHub Action
Insight into my thought process creating one.
In this article I won’t cover how to implement them, GitHub itself has done and amazing job with this article, and this starter project. Instead, I will focus on the things I learned about them while making my own action to automatically triage GitHub issues.
The action
Keeping taps on GitHub issues is difficult, anyone can create them without enforcement of any structure. I wanted to automate this by creating a GitHub action that will make sure all issues are created with the label Bug
to also have a priority and a team label.
Simple is better
Initially, I wanted to create a repository that will hold the action, post it in the GitHub Marketplace, etc. I quickly changed my mind when I discovered the Script Action, which pretty much allows us to inline code directly to any action.
Debugging is hard
I couldn’t find a way to test this locally, creating a debugging repository seems to be the desired approach. Initially, I started that route but only to get the JSON blob sent my GitHub on its actions. Once I had that information, Replit came to the rescue.
Testing
After I had my initial implementation using GitHub script, I realized how difficult it would be to expand functionality without proper testing. Which led me to discard my “simple” approach and rely on a…