ACT: Running GitHub Actions Locally

Tom Brovender
Develeap
Published in
3 min readApr 10, 2023

GitHub Actions is a powerful feature that allows developers to automate workflows for their repositories. However, running these workflows can be time-consuming and cumbersome, especially when trying to debug or test them. This is where ACT comes in, a command-line interface that allows developers to run GitHub Actions locally.

What is ACT?

ACT, or “Automated CI/CD Testing”, developed by Nektos, is an open-source tool that simplifies the process of testing and debugging GitHub Actions. With ACT, developers can run their workflows locally, making it easier to identify issues and fix them quickly.

Why Should You Use Act?

ACT supports a wide range of GitHub Actions features, including matrix builds, secrets, environment variables, and more. It can also execute shell commands, run Docker containers, and interact with the local filesystem.

One of the key benefits of using ACT is that it provides a fast feedback loop. Developers can run tests locally and quickly iterate until they get the desired result, without having to wait for GitHub’s runners to complete the workflow.

ACT also helps developers avoid wasting resources on GitHub’s runners. By testing locally, developers can ensure that their workflows are working correctly before pushing code changes to the repository and triggering a workflow on GitHub’s runners.

In addition to testing, ACT can also be used for developing and debugging GitHub Actions. Developers can use it to build and deploy their workflows locally, allowing them to work on the code without having to push changes to the repository.

ACT is an open-source tool and can be installed on Linux, macOS, and Windows. It can also be integrated with other tools and services, such as Visual Studio Code and GitHub CLI.

Using ACT

Using ACT is straightforward. After installing it, developers can use the same syntax as they would when running workflows on GitHub. The tool reads the .github/workflows directory in the repository and runs the corresponding workflow file.

Try it out for yourself

However, it’s important to keep in mind that when using private actions repositories, testing on local machines might not have the necessary permissions to access other repositories or resources. In such cases, running tests remotely on GitHub runners may be necessary to ensure that the workflows are working as intended in the production environment.

In summary, ACT is a powerful tool that simplifies the process of testing and debugging GitHub Actions. It provides developers with a way to run workflows locally, interact with the local environment, and fine-tune the execution options. By integrating ACT into their development process, developers can ensure that their workflows are working as expected, improving the quality of their code and saving time in the long run.

--

--

Tom Brovender
Develeap

DevOps Enginner @ Develeap | CKA | GitOps | TF Associate