How to test your GitHub Actions locally

Rajvir Singh - Nov 11 '21 - - Dev Community

So Dev & GitHub Team just announced the Github Action Hackathon. I am also participating in it. But I ran into a troublesome problem, and I think some of you guys are too. That is we always have to push the files to the remote repo in order to test the action, But it is a kinda pain to do it every time you make a change. I finally have found a solution to this problem.

Act the solution

"Think globally, act locally"

The two important reasons that you should use Act:

  • Fast Feedback - Rather than having to commit/push every time you want to test out the changes you are making to your .github/workflows/ files (or for any changes to embedded GitHub actions), you can use act to run the actions locally. The environment variables and filesystem are all configured to match what GitHub provides.
  • Local Task Runner - I love make. However, I also hate repeating myself. With act, you can use the GitHub Actions defined in your .github/workflows/ to replace your Makefile!

I copied them from Act's readme, Because I am lazy

Act is pretty reliable for testing actions, And I can go into details but I would be just repeating the stuff that is already on Act's Readme. So if you want deeper dive then you can check Act's Repo.

I hope you guys can figure everything else yourselves, as I am also busy making my project for this hackathon. But I felt an urge to tell others about this amazing tool.

Have a good day, Best of luck!
Rajvir Singh

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player