From the course: GitHub Actions Cert Prep by Microsoft Press

Unlock this course with a free trial

Join today to access over 24,600 courses taught by industry experts.

Demonstrate how to use default environment variables in a workflow

Demonstrate how to use default environment variables in a workflow - GitHub Tutorial

From the course: GitHub Actions Cert Prep by Microsoft Press

Demonstrate how to use default environment variables in a workflow

- [Instructor] We've seen thus far that GitHub provides us with a library of built-in variables like these ones here, GITHUB_SHA and GITHUB_REPOSITORY, that give us, well, quite a bit of flexibility. We can include metadata about GitHub, any aspect of it, and any artifact that we have within GitHub is reachable, and we can share this information with the runners that are processing our workflows. Very powerful stuff indeed. So this is a reminder, don't forget about these default environment variables, and incorporate them in workflow steps to support dynamic behavior. For example, using GITHUB_SHA to tag a built Docker image. Right, that makes sense. Because these environment variables are actually objects that you can interact with as well. It's a very different way of thinking. I admire those GitHub developers. Yes, I value the whole world who pushes their code to GitHub, but I'm talking about the engineers who work for GitHub, who work on the website. Well, let me stop fanboying…

Contents