A Developer Who Wanted His Own CI Tooling

Stefan Zweifel is a full-stack developer working with PHP, Laravel, and Vue.js. He had been thinking about CI/CD tools for years, but the options available three years ago didn't match what he needed.

The available services back then weren't as flexible and easy to understand as GitHub Actions is today.

When GitHub Actions was announced, Zweifel started building immediately. He wrote a blog post about how PHP developers could use his work, and the project that came out of that effort is now used by developers across multiple communities.

The Action: Detecting and Committing File Changes

Zweifel's git-auto-commit Action automatically detects file changes during any workflow run, then commits and pushes those changes back to the repository. He built it for his own needs:

I personally use [git-auto-commit] to let linters automatically fix my PHP and JavaScript code in pull requests. In another project I use the Action in conjunction with the schedule feature of Actions: At the start of each month a Workflow updates a sqlite-database with a new dataset from an API. The Workflows generates a static site based on the sqlite-database and the git-auto-commit Action pushes the updated sqlite-database back to the repository.

Other developers have adopted the Action for a range of workflows, as Zweifel discovered through community discussions. Common uses include:

  • Building JavaScript and CSS assets on GitHub Actions and pushing the built files back to the repository
  • Copying content from other GitHub repositories into a main repository and committing the changes
  • Building static documentation sites and pushing changes to a gh-pages branch
  • Updating the repository and creating a new tag and release

Because git-auto-commit operates at such a low level, the range of possible applications is wide open.

Getting Started Is the Easy Part

Zweifel highlights the low barrier to entry as GitHub Actions' main strength:

My favorite feature of GitHub Actions is the ease of use to get started. You can use an existing Docker Actions template and start working on your next Action within a couple of minutes.

The early challenges, however, came from the authentication layer between the Action runner and GitHub. Many users filed issues about commits failing to push. The v2 release of the checkout Action resolved those problems.

It's challenging but I enjoy the learning experience.

Currently, his biggest hurdle is building out a test suite. His advice to other developers is straightforward:

The most important lesson I've learned so far with Actions – and open source work in general – is to just release your code into the wild and see what happens. If others can benefit from it: great, if they contribute with questions or updates to the docs: even better. If nobody is interested: Well, at least you've made your own life a bit easier.