From bf488663fe42b7a4c6b037f9213d61e8fb145eb0 Mon Sep 17 00:00:00 2001 From: Joe Clark <31087804+jc-clark@users.noreply.github.com> Date: Fri, 3 Nov 2023 14:39:40 -0700 Subject: [PATCH] Update docs for the `github.triggering_actor` context and default variable (#45567) --- content/actions/learn-github-actions/contexts.md | 2 +- content/actions/learn-github-actions/variables.md | 5 ++++- .../reusables/actions/github-triggering-actor-description.md | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 data/reusables/actions/github-triggering-actor-description.md diff --git a/content/actions/learn-github-actions/contexts.md b/content/actions/learn-github-actions/contexts.md index 9e2998b459..63c459485a 100644 --- a/content/actions/learn-github-actions/contexts.md +++ b/content/actions/learn-github-actions/contexts.md @@ -223,7 +223,7 @@ The `github` context contains information about the workflow run and the event t | `github.server_url` | `string` | The URL of the GitHub server. For example: `https://github.com`. | | `github.sha` | `string` | {% data reusables.actions.github_sha_description %} | | `github.token` | `string` | A token to authenticate on behalf of the GitHub App installed on your repository. This is functionally equivalent to the `GITHUB_TOKEN` secret. For more information, see "[AUTOTITLE](/actions/security-guides/automatic-token-authentication)."
Note: This context property is set by the Actions runner, and is only available within the execution `steps` of a job. Otherwise, the value of this property will be `null`. |{% ifversion actions-stable-actor-ids %} -| `github.triggering_actor` | `string` | The username of the user that initiated the workflow run. If the workflow run is a re-run, this value may differ from `github.actor`. Any workflow re-runs will use the privileges of `github.actor`, even if the actor initiating the re-run (`github.triggering_actor`) has different privileges. |{% endif %} +| `github.triggering_actor` | `string` | {% data reusables.actions.github-triggering-actor-description %} |{% endif %} | `github.workflow` | `string` | The name of the workflow. If the workflow file doesn't specify a `name`, the value of this property is the full path of the workflow file in the repository. | {%- ifversion actions-oidc-custom-claims %} | `github.workflow_ref` | `string` | {% data reusables.actions.workflow-ref-description %} | diff --git a/content/actions/learn-github-actions/variables.md b/content/actions/learn-github-actions/variables.md index f57979b780..27bbfc6053 100644 --- a/content/actions/learn-github-actions/variables.md +++ b/content/actions/learn-github-actions/variables.md @@ -13,7 +13,7 @@ versions: ghae: '*' ghec: '*' --- - + {% data reusables.actions.enterprise-github-hosted-runners %} ## About variables @@ -336,6 +336,9 @@ We strongly recommend that actions use variables to access the filesystem rather {%- ifversion actions-job-summaries %} | `GITHUB_STEP_SUMMARY` | The path on the runner to the file that contains job summaries from workflow commands. This file is unique to the current step and changes for each step in a job. For example, `/home/runner/_layout/_work/_temp/_runner_file_commands/step_summary_1cb22d7f-5663-41a8-9ffc-13472605c76c`. For more information, see "[AUTOTITLE](/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary)." | {%- endif %} +{%- ifversion actions-stable-actor-ids %} +| `GITHUB_TRIGGERING_ACTOR` | {% data reusables.actions.github-triggering-actor-description %} | + {%- endif %} | `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. | {%- ifversion actions-oidc-custom-claims %} | `GITHUB_WORKFLOW_REF` | {% data reusables.actions.workflow-ref-description %} | diff --git a/data/reusables/actions/github-triggering-actor-description.md b/data/reusables/actions/github-triggering-actor-description.md new file mode 100644 index 0000000000..5db9a50be8 --- /dev/null +++ b/data/reusables/actions/github-triggering-actor-description.md @@ -0,0 +1 @@ +The username of the user that initiated the workflow run. If the workflow run is a re-run, this value may differ from `github.actor`. Any workflow re-runs will use the privileges of `github.actor`, even if the actor initiating the re-run (`github.triggering_actor`) has different privileges.