From the course: Learning GitHub Actions
Unlock the full course today
Join today to access over 24,200 courses taught by industry experts.
Add an entry-point script - GitHub Tutorial
From the course: Learning GitHub Actions
Add an entry-point script
- [Instructor] Let's get started on the entry point script. The first thing we need to do is make it executable. This will allow the script to be run when the container starts. I'll do that with the chmod +x command. Now let's take a look at the LS of this directory. In this output, we can see that the entry point script is now executable. We can tell by the X entries in the mode for the file. Now let's take a look at the script. At the top is the shebang line. This tells the operating system which interpreter to use to run the script. In this case, we're using Bash. I've also added the set -e directive so Bash will exit the script immediately if an error is encountered. After that are some comments outlining what our script does. If we see the keyword, then do something. If not, exit gracefully. The dollar sign star is a variable that contains the arguments that were passed to the script. So for our if statement,…
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)
Plan a custom action4m 28s
-
(Locked)
Your custom action objective1m 7s
-
(Locked)
Dockerfile review4m 58s
-
(Locked)
Add a Dockerfile2m 20s
-
(Locked)
Add an entry-point script2m 30s
-
(Locked)
Use runtime environment resources4m 11s
-
(Locked)
Test an action locally3m 52s
-
(Locked)
Complete the entry-point script2m 2s
-
(Locked)
Add a metadata file2m 48s
-
(Locked)
Add a README file1m 48s
-
(Locked)
Deploy a custom action2m 22s
-
(Locked)
Publish an action to the Marketplace4m 16s
-
(Locked)
Challenge: Create a custom action1m
-
(Locked)
Solution: Create a custom action7m 47s
-
(Locked)
-