Github Action is one heck of the CI, but you want to create a new CI/CD pipeline in Github. The only way to test is the making push or pull requests to the respective repository.

What if I tell you there is one more way to test run Github actions.

https://github.com/nektos/act is one of the solutions for testing your pipeline on local for syntax fix or even fixing script before pushing to Github.

For Mac, it is a straightforward install.

brew install act

It will download and install the dependencies for the local run. To use it in a repository, clone the repo on the local machine

Once it is installed, go to the root directory. We can start experimenting with stuff like total steps in the workflow. I have only step workflow to show which GitHub provides. So it is showing as stage 0.

$ act -l
ID     Stage  Name

test   0      test
build  0      build

the act is the command used to run the workflow. It will ask for the image that you want to use to run the workflow. Please choose an image as per your requirement. More details are mentioned in that repo’s README.

#github #github-actions #devops

Running Github Actions On Local Machine
1.20 GEEK