From the course: Learning GitHub Actions

Unlock the full course today

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

Passing arguments to an action

Passing arguments to an action - GitHub Tutorial

From the course: Learning GitHub Actions

Start my 1-month free trial

Passing arguments to an action

- [Instructor] Most actions will run as intended without any input, but some actions require arguments to determine how the action will operate in a workflow. To pass arguments to a step, we use the with attribute. This creates a new block in the step where we can map arguments to the input parameters defined by the action. Like other YAML blocks that define maps, each input parameter is a key value pair. In this example, we're adding a step that uses GitHub's checkout action. To set up the step to pass arguments to the checkout action, we would add the with attribute after the uses attribute, then we would add arguments as keys and their corresponding values. The checkout action can take several arguments. Let's look at a few of them. For the repository argument, I've added apache/tomcat as the value. This tells the checkout action to check out all the code from the Apache Tomcat repo on github.com. If the repository…

Contents