From the course: Learning GitHub Actions

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Test an action locally

Test an action locally - GitHub Tutorial

From the course: Learning GitHub Actions

Start my 1-month free trial

Test an action locally

- [Instructor] Now that we know more about the resources available to our custom action, let's finish our entrypoint script. To help in our development, I've created two more files, a makefile, and a JSON file with a sample push event. Let's look at the makefile. At the top of the makefile, I define a default for the keyword I want to test with. I'm using the word fixed so I'll be looking for commit messages with the word fixed in them. Following that are three build targets that will help us while testing our script. The run target builds the image before running it with the default keyword. The build target uses our Docker file to compile the Docker image and tags it with the name keyword-release-action. And finally, the test target runs the entrypoint script with a test keyword. I don't know about you, but I either forget these commands or get tired of typing them, so I appreciate having a makefile to help while I'm…

Contents