Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Automating Workflows with GitHub Actions
  • Table Of Contents Toc
Automating Workflows with GitHub Actions

Automating Workflows with GitHub Actions

By : Priscila Heller
4.4 (13)
close
close
Automating Workflows with GitHub Actions

Automating Workflows with GitHub Actions

4.4 (13)
By: Priscila Heller

Overview of this book

GitHub Actions is one of the most popular products that enables you to automate development tasks and improve your software development workflow. Automating Workflows with GitHub Actions uses real-world examples to help you automate everyday tasks and use your resources efficiently. This book takes a practical approach to helping you develop the skills needed to create complex YAML files to automate your daily tasks. You'll learn how to find and use existing workflows, allowing you to get started with GitHub Actions right away. Moving on, you'll discover complex concepts and practices such as self-hosted runners and writing workflow files that leverage other platforms such as Docker as well as programming languages such as Java and JavaScript. As you advance, you'll be able to write your own JavaScript, Docker, and composite run steps actions, and publish them in GitHub Marketplace! You'll also find instructions to migrate your existing CI/CD workflows into GitHub Actions from platforms like Travis CI and GitLab. Finally, you'll explore tools that'll help you stay informed of additions to GitHub Actions along with finding technical support and staying engaged with the community. By the end of this GitHub book, you'll have developed the skills and experience needed to build and maintain your own CI/CD pipeline using GitHub Actions.
Table of Contents (14 chapters)
close
close
1
Section 1:Introduction and Overview of Technologies Used with GitHub Actions
4
Section 2: Advanced Concepts and Hands-On Exercises to Create Actions
9
Section 3: Customizing Existing Actions, Migrations, and the Future of GitHub Actions

Using exit codes

Adding exit codes to your action can help you monitor the action's check run status.

GitHub displays statuses to illustrate whether an action run succeeded or failed. Those statuses are binary and simply represent whether an action run succeeded or failed, and are outlined further here:

  1. The action completed successfully—Exit status is 0 and the check run status is success.
  2. The action failed—Exit status is non-zero (any integer) and the check run status is failed. All concurrent actions are cancelled, and future actions are skipped.

Adding exit codes to a JavaScript action

Use the @actions/core actions toolkit package to set failure exit codes and log a message, as follows:

try {
  // add thing to be tried here
} catch (error) {
  core.setFailed(error.message);
}

Adding exit codes to a Docker container action

Use your entrypoint.sh file to add a failure exit code, as follows:

if <this happens...
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Automating Workflows with GitHub Actions
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon