Creating a GitHub Action
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.
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.
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 full node project. Thankfully the starter project mentioned before helped out.
Github Actions are an amazing feature to supercharge your workflows, I would 100% recommend using them if you ever wish to take GitHub further.
As always, this solution is 100% open sourced, feel free to modify it or give it a try.