GHA
01 Jan 2023 • Leave CommentsRunner
Each GitHub-hosted runner is a new virtual machine (VM) hosted by GitHub with the runner application and other tools preinstalled, and is available with Ubuntu Linux, Windows, or macOS operating systems. When you use a GitHub-hosted runner, machine maintenance and upgrades are taken care of for you.
Each GHA job has its own standalone runner and specifies the types of runners by runs-on
.
See more details about runner at Using GitHub-hosted runners.
Persist Output
We can share values among steps of a job, or even among jobs.
- To share values among steps of a job, please use GITHUB_ENV or GITHUB_OUTPUT.
-
Output variables
GITHUB_OUTPUT
is a GHA feature. We can access to such variables only with GHA syntax.${{ steps.<step-id>.outputs.my_var }}
-
Environment variables
GITHUB_ENV
is a Shell feature of the runner. We can access to such variables both with Shell syntax or GHA syntax.$my_var ${{ env.my_var }}
However, in the well-know actions/github-script, we access the environment variables via process.env.my_var.
-
- To share values among jobs, please try the following methods.