Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Automating Workflows with GitHub Actions

You're reading from   Automating Workflows with GitHub Actions Automate software development workflows and seamlessly deploy your applications using GitHub Actions

Arrow left icon
Product type Paperback
Published in Nov 2021
Publisher Packt
ISBN-13 9781800560406
Length 216 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Priscila Heller Priscila Heller
Author Profile Icon Priscila Heller
Priscila Heller
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Section 1:Introduction and Overview of Technologies Used with GitHub Actions
2. Chapter 1: Learning the Foundations for GitHub Actions FREE CHAPTER 3. Chapter 2: Deep Diving into GitHub Actions 4. Section 2: Advanced Concepts and Hands-On Exercises to Create Actions
5. Chapter 3: A Closer Look at Workflows 6. Chapter 4: Working with Self-Hosted Runners 7. Chapter 5: Writing Your Own Actions 8. Chapter 6: Marketplace – Finding Existing Actions and Publishing Your Own 9. Section 3: Customizing Existing Actions, Migrations, and the Future of GitHub Actions
10. Chapter 7: Migrations 11. Chapter 8: Contributing to the Community and Finding Help 12. Chapter 9: The Future of GitHub Actions 13. Other Books You May Enjoy

Understanding contexts, environment variables, and expressions

Some of the workflow examples we've shared throughout this book have included expressions, contexts, and environment variables. This section will provide more details about each.

Contexts

You can use contexts to access information about steps, workflow runs, jobs, and runner environments. Any time you want to access a context from within a workflow file, you need to use a syntax similar to ${{ <context-goes-here> }}. The following example shows how to access the steps context:

tag_name: ${{ steps.gets_project_name.outputs.project_name }}

Contexts can be used mostly anywhere in your workflow file. They are often used with expressions to check for specific conditions. The following example uses the if statement to validate the github context. In this case, the job will only run if the result of the expression is approved:

if: github.event_name == 'pull_request_review' && github...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime