From the course: Learning GitHub Actions
Unlock the full course today
Join today to access over 24,200 courses taught by industry experts.
Passing arguments to an action - GitHub Tutorial
From the course: Learning GitHub Actions
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Use an action from the Marketplace4m 6s
-
(Locked)
Use an action from a repository2m 25s
-
(Locked)
Passing arguments to an action4m 6s
-
(Locked)
Using environment variables5m 10s
-
(Locked)
Using secrets4m 1s
-
(Locked)
Using artifacts4m 7s
-
(Locked)
Manage pull requests3m 30s
-
(Locked)
Challenge: Develop a workflow that creates an artifact57s
-
(Locked)
Solution: Develop a workflow that creates an artifact8m 6s
-
(Locked)
-
-
-