Go Action: A Library That Turns Go Scripts Into GitHub Actions

Eyal Posener, a Go software developer, built goaction to lower the barrier for Go developers who want to create GitHub Actions. What started as a tool to auto-generate README files has grown into a general-purpose library for writing Actions entirely in Go.

From GitHub App to Action

The project originally ran as a GitHub App that automatically produced README files for Go repositories. That approach had two problems: the structure was overly complex, and potential users were hesitant to grant the app credentials to their repositories.

When GitHub Actions launched, Posener saw a chance to simplify the project. Since the code was already written in Go, he used the migration as an opportunity to build reusable infrastructure for creating Actions in Go. The result is goaction, which lets developers write a standard Go script that works both locally and as a GitHub Action.

Beyond that core capability, the library ships with a statically typed GitHub Actions API and a GitHub API client tailored to the current repository. Perhaps most notably, the goaction repository itself is also an Action: it automatically creates and updates the boilerplate needed to turn any Go repository into a GitHub Action.

Why Go Developers Should Care

Posener appreciates Go for its clean and readable code, and goaction extends that sensibility to automation workflows. Developers don't need to learn a separate workflow language or shell scripting to build an Action — they can write familiar Go code and run it locally for testing.

The project also removes the security friction that plagued his earlier GitHub App design. Instead of granting an external app access to a repository, users can embed the logic directly into their workflow as an Action.

Posener describes GitHub Actions as "simple, powerful, free," and points to the "super detailed" documentation as a key reason for getting started. For those new to Actions, GitHub's Learning Lab offers a guided course on implementing them. Developers can also explore community-built Actions from GitHub's Actions Hackathon events.