Released: GitHub Actions Usage Extension
A client has recently begun a transition of their Continuous Integration work from an on-prem CI implementation to GitHub Actions. As the projects transition over, they’re in the process of discovering how many GitHub Actions minutes they’ll need when the projects settle into the new routine.
At the moment, the process of tracking the usage of projects is somewhat painful. You can:
- Get a summary of “Minutes” and “Storage for Actions and Packages” in Billing settings
- Download a CSV Usage report
- This “report” is basically raw data at the day/project level
- And it’s also a mix of time and storage
- Getting answers out of this requires downloading the data and doing some sums
Fortunately, there’s a GitHub API that provides information about minutes used on a per-workflow basis. I can’t find actions storage anywhere in the API, but I can at least calculate and display Actions minutes per workflow, per repo and across an organization this way. Since GitHub CLI v2.x supports extensions, I built a small extension, gh-actuse that you can use to more easily access GitHub Actions usage:
At the moment, the promoted path for GitHub CLI extensions is a bash script that wraps the existing gh
command line interface (CLI). It’s a bit painful (shell scripts usually are, IMO), but it does work. There is some upcoming support for a method of making binary extensions in Go that would likely be faster and a better coding experience, but that’s not ready yet. When it is, I’ll probably transition gh-actuse
over to that new model.
In the meantime, if you need to monitor your GitHub Actions usage, I hope you’ll find this gh cli extension to be useful.