Skip to content

Commit cbb32c5

Browse files
Explain that GITHUB_SHA may not always be the commit that was pushed
Fixes github#15302
1 parent 54cbc20 commit cbb32c5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/actions/learn-github-actions/environment-variables.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ We strongly recommend that actions use environment variables to access the files
156156
| `GITHUB_RUN_ID` | {% data reusables.github-actions.run_id_description %} For example, `1658821493`. |
157157
| `GITHUB_RUN_NUMBER` | {% data reusables.github-actions.run_number_description %} For example, `3`. |
158158
| `GITHUB_SERVER_URL`| The URL of the {% data variables.product.product_name %} server. For example: `https://{% data variables.product.product_url %}`.
159-
| `GITHUB_SHA` | The commit SHA that triggered the workflow. For example, `ffac537e6cbbf934b08745a378932722df287a53`. |
159+
| `GITHUB_SHA` | The commit SHA that triggered the workflow. The value of this commit depends on the event that triggered the workflow. For more information, see [Events that trigger workflows](/actions/using-workflows/events-that-trigger-workflows). For example, `ffac537e6cbbf934b08745a378932722df287a53`. |
160160
| `GITHUB_WORKFLOW` | The name of the workflow. For example, `My test workflow`. If the workflow file doesn't specify a `name`, the value of this variable is the full path of the workflow file in the repository. |
161161
| `GITHUB_WORKSPACE` | The default working directory on the runner for steps, and the default location of your repository when using the [`checkout`](https://github.com/actions/checkout) action. For example, `/home/runner/work/my-repo-name/my-repo-name`. |
162162
{%- if actions-runner-arch-envvars %}
@@ -202,4 +202,4 @@ In this example, the two `if` statements check the `os` property of the `runner`
202202
If you generate a value in one step of a job, you can use the value in subsequent steps of the same job by assigning the value to an existing or new environment variable and then writing this to the `GITHUB_ENV` environment file. The environment file can be used directly by an action, or from a shell command in the workflow file by using the `run` keyword. For more information, see "[Workflow commands for {% data variables.product.prodname_actions %}](/actions/reference/workflow-commands-for-github-actions/#setting-an-environment-variable)."
203203

204204
If you want to pass a value from a step in one job in a workflow to a step in another job in the workflow, you can define the value as a job output. You can then reference this job output from a step in another job. For more information, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idoutputs)."
205-
205+

0 commit comments

Comments
 (0)