Add documentation for new OIDC claims, default variables, and contexts (#33719)

Co-authored-by: Lucas Costi <lucascosti@users.noreply.github.com>
This commit is contained in:
Joe Clark 2023-01-10 17:01:25 -08:00 коммит произвёл GitHub
Родитель 2b25e8798d
Коммит 83bdd63b1d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
10 изменённых файлов: 94 добавлений и 45 удалений

Просмотреть файл

@ -17,9 +17,9 @@ topics:
## Overview of OpenID Connect
{% data variables.product.prodname_actions %} workflows are often designed to access a cloud provider (such as AWS, Azure, GCP, or HashiCorp Vault) in order to deploy software or use the cloud's services. Before the workflow can access these resources, it will supply credentials, such as a password or token, to the cloud provider. These credentials are usually stored as a secret in {% data variables.product.prodname_dotcom %}, and the workflow presents this secret to the cloud provider every time it runs.
{% data variables.product.prodname_actions %} workflows are often designed to access a cloud provider (such as AWS, Azure, GCP, or HashiCorp Vault) in order to deploy software or use the cloud's services. Before the workflow can access these resources, it will supply credentials, such as a password or token, to the cloud provider. These credentials are usually stored as a secret in {% data variables.product.prodname_dotcom %}, and the workflow presents this secret to the cloud provider every time it runs.
However, using hardcoded secrets requires you to create credentials in the cloud provider and then duplicate them in {% data variables.product.prodname_dotcom %} as a secret.
However, using hardcoded secrets requires you to create credentials in the cloud provider and then duplicate them in {% data variables.product.prodname_dotcom %} as a secret.
With OpenID Connect (OIDC), you can take a different approach by configuring your workflow to request a short-lived access token directly from the cloud provider. Your cloud provider also needs to support OIDC on their end, and you must configure a trust relationship that controls which workflows are able to request the access tokens. Providers that currently support OIDC include Amazon Web Services, Azure, Google Cloud Platform, and HashiCorp Vault, among others.
@ -27,7 +27,7 @@ With OpenID Connect (OIDC), you can take a different approach by configuring you
By updating your workflows to use OIDC tokens, you can adopt the following good security practices:
- **No cloud secrets**: You won't need to duplicate your cloud credentials as long-lived {% data variables.product.prodname_dotcom %} secrets. Instead, you can configure the OIDC trust on your cloud provider, and then update your workflows to request a short-lived access token from the cloud provider through OIDC.
- **No cloud secrets**: You won't need to duplicate your cloud credentials as long-lived {% data variables.product.prodname_dotcom %} secrets. Instead, you can configure the OIDC trust on your cloud provider, and then update your workflows to request a short-lived access token from the cloud provider through OIDC.
- **Authentication and authorization management**: You have more granular control over how workflows can use credentials, using your cloud provider's authentication (authN) and authorization (authZ) tools to control access to cloud resources.
- **Rotating credentials**: With OIDC, your cloud provider issues a short-lived access token that is only valid for a single job, and then automatically expires.
@ -48,7 +48,7 @@ When you configure your cloud to trust {% data variables.product.prodname_dotcom
- Before granting an access token, your cloud provider checks that the [`subject`](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims) and other claims used to set conditions in its trust settings match those in the request's JSON Web Token (JWT). As a result, you must take care to correctly define the _subject_ and other conditions in your cloud provider.
- The OIDC trust configuration steps and the syntax to set conditions for cloud roles (using _Subject_ and other claims) will vary depending on which cloud provider you're using. For some examples, see "[Example subject claims](#example-subject-claims)."
### Understanding the OIDC token
Each job requests an OIDC token from {% data variables.product.prodname_dotcom %}'s OIDC provider, which responds with an automatically generated JSON web token (JWT) that is unique for each workflow job where it is generated. When the job runs, the OIDC token is presented to the cloud provider. To validate the token, the cloud provider checks if the OIDC token's subject and other claims are a match for the conditions that were preconfigured on the cloud role's OIDC trust definition.
@ -92,51 +92,58 @@ The following example OIDC token uses a subject (`sub`) that references a job en
}
```
To see all the claims supported by {% data variables.product.prodname_dotcom %}'s OIDC provider, review the `claims_supported` entries at
To see all the claims supported by {% data variables.product.prodname_dotcom %}'s OIDC provider, review the `claims_supported` entries at
{% ifversion ghes %}`https://HOSTNAME/_services/token/.well-known/openid-configuration`{% else %}https://token.actions.githubusercontent.com/.well-known/openid-configuration{% endif %}.
The token includes the standard audience, issuer, and subject claims:
| Claim | Description |
| ----------- | ---------------------- |
| `aud`| _(Audience)_ By default, this is the URL of the repository owner, such as the organization that owns the repository. This is the only claim that can be customized. You can set a custom audience with a toolkit command: [`core.getIDToken(audience)`](https://www.npmjs.com/package/@actions/core/v/1.6.0) |
| `iss`| _(Issuer)_ The issuer of the OIDC token: {% ifversion ghes %}`https://HOSTNAME/_services/token`{% else %}`https://token.actions.githubusercontent.com`{% endif %} |
| `aud`| _(Audience)_ By default, this is the URL of the repository owner, such as the organization that owns the repository. This is the only claim that can be customized. You can set a custom audience with a toolkit command: [`core.getIDToken(audience)`](https://www.npmjs.com/package/@actions/core/v/1.6.0) |
| `iss`| _(Issuer)_ The issuer of the OIDC token: {% ifversion ghes %}`https://HOSTNAME/_services/token`{% else %}`https://token.actions.githubusercontent.com`{% endif %} |
| `sub`| _(Subject)_ Defines the subject claim that is to be validated by the cloud provider. This setting is essential for making sure that access tokens are only allocated in a predictable way.|
The OIDC token also includes additional standard claims:
| Claim | Description |
| ----------- | ---------------------- |
| `alg`| _(Algorithm)_ The algorithm used by the OIDC provider. |
| `exp`| _(Expires at)_ Identifies the expiry time of the JWT. |
| `iat`| _(Issued at)_ The time when the JWT was issued. |
| `jti`| _(JWT token identifier)_ Unique identifier for the OIDC token. |
| `kid`| _(Key identifier)_ Unique key for the OIDC token. |
| `nbf`| _(Not before)_ JWT is not valid for use before this time. |
| `typ`| _(Type)_ Describes the type of token. This is a JSON Web Token (JWT). |
| `alg`| _(Algorithm)_ The algorithm used by the OIDC provider. |
| `exp`| _(Expires at)_ Identifies the expiry time of the JWT. |
| `iat`| _(Issued at)_ The time when the JWT was issued. |
| `jti`| _(JWT token identifier)_ Unique identifier for the OIDC token. |
| `kid`| _(Key identifier)_ Unique key for the OIDC token. |
| `nbf`| _(Not before)_ JWT is not valid for use before this time. |
| `typ`| _(Type)_ Describes the type of token. This is a JSON Web Token (JWT). |
The token also includes custom claims provided by {% data variables.product.prodname_dotcom %}:
| Claim | Description |
| ----------- | ---------------------- |
| `actor`| The personal account that initiated the workflow run. |
| `actor`| The personal account that initiated the workflow run. |
| `actor_id`| The ID of personal account that initiated the workflow run. |
| `base_ref`| The target branch of the pull request in a workflow run. |
| `environment`| The name of the environment used by the job. |
| `event_name`| The name of the event that triggered the workflow run. |
| `head_ref`| The source branch of the pull request in a workflow run. |
| `job_workflow_ref`| This is the ref path to the reusable workflow used by this job. For more information, see "["Using OpenID Connect with reusable workflows"](/actions/deployment/security-hardening-your-deployments/using-openid-connect-with-reusable-workflows)." |
| `ref`| _(Reference)_ The git ref that triggered the workflow run. |
| `ref_type`| The type of `ref`, for example: "branch". |
| `repository_visibility` | The visibility of the repository where the workflow is running. Accepts the following values: `internal`, `private`, or `public`. |
| `repository`| The repository from where the workflow is running. |
| `base_ref`| The target branch of the pull request in a workflow run. |
| `environment`| The name of the environment used by the job. |
| `event_name`| The name of the event that triggered the workflow run. |
| `head_ref`| The source branch of the pull request in a workflow run. |
| `job_workflow_ref`| For jobs using a reusable workflow, the ref path to the reusable workflow. For more information, see "[Using OpenID Connect with reusable workflows](/actions/deployment/security-hardening-your-deployments/using-openid-connect-with-reusable-workflows)." |
{%- ifversion actions-oidc-custom-claims %}
| `job_workflow_sha`| {% data reusables.actions.job-workflow-sha-description %} |
{%- endif %}
| `ref`| _(Reference)_ The git ref that triggered the workflow run. |
| `ref_type`| The type of `ref`, for example: "branch". |
| `repository_visibility` | The visibility of the repository where the workflow is running. Accepts the following values: `internal`, `private`, or `public`. |
| `repository`| The repository from where the workflow is running. |
| `repository_id`| The ID of the repository from where the workflow is running. |
| `repository_owner`| The name of the organization in which the `repository` is stored. |
| `repository_owner`| The name of the organization in which the `repository` is stored. |
| `repository_owner_id`| The ID of the organization in which the `repository` is stored. |
| `run_id`| The ID of the workflow run that triggered the workflow. |
| `run_number`| The number of times this workflow has been run. |
| `run_attempt`| The number of times this workflow run has been retried. |
| `workflow`| The name of the workflow. |
| `run_id`| The ID of the workflow run that triggered the workflow. |
| `run_number`| The number of times this workflow has been run. |
| `run_attempt`| The number of times this workflow run has been retried. |
| `workflow`| The name of the workflow. |
{%- ifversion actions-oidc-custom-claims %}
| `workflow_ref`| {% data reusables.actions.workflow-ref-description %} |
| `workflow_sha`| {% data reusables.actions.workflow-sha-description %} |
{%- endif %}
### Defining trust conditions on cloud roles using OIDC claims
@ -168,7 +175,7 @@ You can configure a subject that filters for a specific [environment](/actions/d
| | |
| ------ | ----------- |
| Syntax: | `repo:<orgName/repoName>:environment:<environmentName>` |
| Syntax: | `repo:<orgName/repoName>:environment:<environmentName>` |
| Example:| `repo:octo-org/octo-repo:environment:Production` |
#### Filtering for `pull_request` events
@ -179,7 +186,7 @@ You can configure a subject that filters for the [`pull_request`](/actions/learn
| | |
| ------ | ----------- |
| Syntax: | `repo:<orgName/repoName>:pull_request` |
| Syntax: | `repo:<orgName/repoName>:pull_request` |
| Example:| `repo:octo-org/octo-repo:pull_request` |
#### Filtering for a specific branch
@ -190,7 +197,7 @@ You can configure a subject that filters for a specific branch name. In this exa
| | |
| ------ | ----------- |
| Syntax: | `repo:<orgName/repoName>:ref:refs/heads/branchName` |
| Syntax: | `repo:<orgName/repoName>:ref:refs/heads/branchName` |
| Example:| `repo:octo-org/octo-repo:ref:refs/heads/demo-branch` |
#### Filtering for a specific tag
@ -201,7 +208,7 @@ You can create a subject that filters for specific tag. In this example, the wor
| | |
| ------ | ----------- |
| Syntax: | `repo:<orgName/repoName>:ref:refs/tags/<tagName>` |
| Syntax: | `repo:<orgName/repoName>:ref:refs/tags/<tagName>` |
| Example:| `repo:octo-org/octo-repo:ref:refs/tags/demo-tag` |
### Configuring the subject in your cloud provider
@ -210,7 +217,7 @@ To configure the subject in your cloud provider's trust relationship, you must a
| | |
| ------ | ----------- |
| Amazon Web Services | `"{% ifversion ghes %}HOSTNAME/_services/token{% else %}token.actions.githubusercontent.com{% endif %}:sub": "repo:octo-org/octo-repo:ref:refs/heads/demo-branch"` |
| Amazon Web Services | `"{% ifversion ghes %}HOSTNAME/_services/token{% else %}token.actions.githubusercontent.com{% endif %}:sub": "repo:octo-org/octo-repo:ref:refs/heads/demo-branch"` |
| Azure| `repo:octo-org/octo-repo:ref:refs/heads/demo-branch` |
| Google Cloud Platform| `(assertion.sub=='repo:octo-org/octo-repo:ref:refs/heads/demo-branch')` |
| HashiCorp Vault| `bound_subject="repo:octo-org/octo-repo:ref:refs/heads/demo-branch" ` |
@ -225,7 +232,7 @@ You could also use a `curl` command to request the JWT, using the following envi
| | |
| ------ | ----------- |
| `ACTIONS_ID_TOKEN_REQUEST_URL` | The URL for {% data variables.product.prodname_dotcom %}'s OIDC provider. |
| `ACTIONS_ID_TOKEN_REQUEST_URL` | The URL for {% data variables.product.prodname_dotcom %}'s OIDC provider. |
| `ACTIONS_ID_TOKEN_REQUEST_TOKEN` | Bearer token for the request to the OIDC provider. |
@ -256,7 +263,7 @@ To customize these claim formats, organization and repository admins can use the
By default, the JWT is issued by {% data variables.product.prodname_dotcom %}'s OIDC provider at `https://token.actions.githubusercontent.com`. This path is presented to your cloud provider using the `iss` value in the JWT.
Enterprise admins can security harden their OIDC configuration by configuring their enterprise to receive tokens from a unique URL at `https://token.actions.githubusercontent.com/<enterpriseSlug>`. Replace `<enterpriseSlug>` with the slug value of your enterprise.
Enterprise admins can security harden their OIDC configuration by configuring their enterprise to receive tokens from a unique URL at `https://token.actions.githubusercontent.com/<enterpriseSlug>`. Replace `<enterpriseSlug>` with the slug value of your enterprise.
This configuration means that your enterprise will receive the OIDC token from a unique URL, and you can then configure your cloud provider to only accept tokens from that URL. This helps ensure that only the enterprise's repositories can access your cloud resources using OIDC.
@ -291,7 +298,7 @@ To help improve security, compliance, and standardization, you can customize the
Customizing the claims results in a new format for the entire `sub` claim, which replaces the default predefined `sub` format in the token described in "[Example subject claims](/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#example-subject-claims)."
The following example templates demonstrate various ways to customize the subject claim. To configure these settings on {% data variables.product.prodname_dotcom %}, admins use the REST API to specify a list of claims that must be included in the subject (`sub`) claim.
The following example templates demonstrate various ways to customize the subject claim. To configure these settings on {% data variables.product.prodname_dotcom %}, admins use the REST API to specify a list of claims that must be included in the subject (`sub`) claim.
{% data reusables.actions.use-request-body-api %}
@ -314,7 +321,7 @@ In your cloud provider's OIDC configuration, configure the `sub` condition to re
#### Example: Allowing access to all repositories with a specific owner
This example template enables the `sub` claim to have a new format with only the value of `repository_owner`.
This example template enables the `sub` claim to have a new format with only the value of `repository_owner`.
{% data reusables.actions.use-request-body-api %}
@ -365,12 +372,12 @@ This example also demonstrates how to use `"context"` to define your conditions.
In your cloud provider's OIDC configuration, configure the `sub` condition to require that claims must include specific values for `repo`, `context`, and `job_workflow_ref`.
This customization template requires that the `sub` uses the following format: `repo:<orgName/repoName>:environment:<environmentName>:job_workflow_ref:<reusableWorkflowPath>`.
This customization template requires that the `sub` uses the following format: `repo:<orgName/repoName>:environment:<environmentName>:job_workflow_ref:<reusableWorkflowPath>`.
For example: `"sub": "repo:octo-org/octo-repo:environment:prod:job_workflow_ref:octo-org/octo-automation/.github/workflows/oidc.yml@refs/heads/main"`
#### Example: Granting access to a specific repository
This example template lets you grant cloud access to all the workflows in a specific repository, across all branches/tags and environments. To help improve security, combine this template with the custom issuer URL described in "[Customizing the token URL for an enterprise](/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#customizing-the-token-url-for-an-enterprise)."
This example template lets you grant cloud access to all the workflows in a specific repository, across all branches/tags and environments. To help improve security, combine this template with the custom issuer URL described in "[Customizing the token URL for an enterprise](/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#customizing-the-token-url-for-an-enterprise)."
{% data reusables.actions.use-request-body-api %}
@ -386,7 +393,7 @@ In your cloud provider's OIDC configuration, configure the `sub` condition to re
#### Example: Using system-generated GUIDs
This example template enables predictable OIDC claims with system-generated GUIDs that do not change between renames of entities (such as renaming a repository).
This example template enables predictable OIDC claims with system-generated GUIDs that do not change between renames of entities (such as renaming a repository).
{% data reusables.actions.use-request-body-api %}
@ -431,7 +438,7 @@ In your cloud provider's OIDC configuration, configure the `sub` condition to re
#### Using the default subject claims
For repositories that can receive a subject claim policy from their organization, the repository owner can later choose to opt-out and instead use the default `sub` claim format. This means that the repository will not use the organization's customized template.
For repositories that can receive a subject claim policy from their organization, the repository owner can later choose to opt-out and instead use the default `sub` claim format. This means that the repository will not use the organization's customized template.
To configure the repository to use the default `sub` claim format, a repository admin must use the REST API endpoint at "[Set the customization template for an OIDC subject claim for a repository](/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository)" with the following request body:

Просмотреть файл

@ -191,6 +191,9 @@ The `github` context contains information about the workflow run and the event t
| `github.action_repository` | `string` | For a step executing an action, this is the owner and repository name of the action. For example, `actions/checkout`. |
| `github.action_status` | `string` | For a composite action, the current result of the composite action. |
| `github.actor` | `string` | {% ifversion actions-stable-actor-ids %}The username of the user that triggered the initial workflow run. If the workflow run is a re-run, this value may differ from `github.triggering_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.{% else %}The username of the user that initiated the workflow run.{% endif %} |
{%- ifversion actions-oidc-custom-claims %}
| `github.actor_id` | `string` | {% data reusables.actions.actor_id-description %} |
{%- endif %}
| `github.api_url` | `string` | The URL of the {% data variables.product.prodname_dotcom %} REST API. |
| `github.base_ref` | `string` | The `base_ref` or target branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is either `pull_request` or `pull_request_target`. |
| `github.env` | `string` | Path on the runner to the file that sets environment variables from workflow commands. This file is unique to the current step and is a different file for each step in a job. For more information, see "[Workflow commands for {% data variables.product.prodname_actions %}](/actions/learn-github-actions/workflow-commands-for-github-actions#setting-an-environment-variable)." |
@ -200,6 +203,9 @@ The `github` context contains information about the workflow run and the event t
| `github.graphql_url` | `string` | The URL of the {% data variables.product.prodname_dotcom %} GraphQL API. |
| `github.head_ref` | `string` | The `head_ref` or source branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is either `pull_request` or `pull_request_target`. |
| `github.job` | `string` | The [`job_id`](/actions/reference/workflow-syntax-for-github-actions#jobsjob_id) of the current job. <br /> 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-oidc-custom-claims %}
| `github.job_workflow_sha` | `string` | {% data reusables.actions.job-workflow-sha-description %} |
{%- endif %}
| `github.ref` | `string` | {% data reusables.actions.ref-description %} |
{%- ifversion fpt or ghec or ghes > 3.3 or ghae > 3.3 %}
| `github.ref_name` | `string` | {% data reusables.actions.ref_name-description %} |
@ -207,9 +213,15 @@ The `github` context contains information about the workflow run and the event t
| `github.ref_type` | `string` | {% data reusables.actions.ref_type-description %} |
{%- endif %}
| `github.path` | `string` | Path on the runner to the file that sets system `PATH` variables from workflow commands. This file is unique to the current step and is a different file for each step in a job. For more information, see "[Workflow commands for {% data variables.product.prodname_actions %}](/actions/learn-github-actions/workflow-commands-for-github-actions#adding-a-system-path)." |
| `github.repository` | `string` | The owner and repository name. For example, `Codertocat/Hello-World`. |
| `github.repository_owner` | `string` | The repository owner's name. For example, `Codertocat`. |
| `github.repositoryUrl` | `string` | The Git URL to the repository. For example, `git://github.com/codertocat/hello-world.git`. |
| `github.repository` | `string` | The owner and repository name. For example, `octocat/Hello-World`. |
{%- ifversion actions-oidc-custom-claims %}
| `github.repository_id` | `string` | {% data reusables.actions.repository_id-description %} |
{%- endif %}
| `github.repository_owner` | `string` | The repository owner's username. For example, `octocat`. |
{%- ifversion actions-oidc-custom-claims %}
| `github.repository_owner_id` | `string` | {% data reusables.actions.repository_owner_id-description %} |
{%- endif %}
| `github.repositoryUrl` | `string` | The Git URL to the repository. For example, `git://github.com/octocat/hello-world.git`. |
| `github.retention_days` | `string` | The number of days that workflow run logs and artifacts are kept. |
| `github.run_id` | `string` | {% data reusables.actions.run_id_description %} |
| `github.run_number` | `string` | {% data reusables.actions.run_number_description %} |
@ -224,6 +236,10 @@ The `github` context contains information about the workflow run and the event t
| `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 "[Automatic token authentication](/actions/security-guides/automatic-token-authentication)." <br /> 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.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 %} |
| `github.workflow_sha` | `string` | {% data reusables.actions.workflow-sha-description %} |
{%- endif %}
| `github.workspace` | `string` | 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. |
### Example contents of the `github` context

Просмотреть файл

@ -240,6 +240,9 @@ We strongly recommend that actions use variables to access the filesystem rather
| `GITHUB_ACTION_REPOSITORY` | For a step executing an action, this is the owner and repository name of the action. For example, `actions/checkout`. |
| `GITHUB_ACTIONS` | Always set to `true` when {% data variables.product.prodname_actions %} is running the workflow. You can use this variable to differentiate when tests are being run locally or by {% data variables.product.prodname_actions %}.
| `GITHUB_ACTOR` | The name of the person or app that initiated the workflow. For example, `octocat`. |
{%- ifversion actions-oidc-custom-claims %}
| `GITHUB_ACTOR_ID` | {% data reusables.actions.actor_id-description %} |
{%- endif %}
| `GITHUB_API_URL` | Returns the API URL. For example: `{% data variables.product.api_url_code %}`.
| `GITHUB_BASE_REF` | The name of the base ref or target branch of the pull request in a workflow run. This is only set when the event that triggers a workflow run is either `pull_request` or `pull_request_target`. For example, `main`. |
| `GITHUB_ENV` | The path on the runner to the file that sets variables from workflow commands. This file is unique to the current step and changes for each step in a job. For example, `/home/runner/work/_temp/_runner_file_commands/set_env_87406d6e-4979-4d42-98e1-3dab1f48b13a`. For more information, see "[Workflow commands for {% data variables.product.prodname_actions %}](/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable)." |
@ -256,7 +259,13 @@ We strongly recommend that actions use variables to access the filesystem rather
| `GITHUB_REF_TYPE` | {% data reusables.actions.ref_type-description %} |
{%- endif %}
| `GITHUB_REPOSITORY` | The owner and repository name. For example, `octocat/Hello-World`. |
{%- ifversion actions-oidc-custom-claims %}
| `GITHUB_REPOSITORY_ID` | {% data reusables.actions.repository_id-description %} |
{%- endif %}
| `GITHUB_REPOSITORY_OWNER` | The repository owner's name. For example, `octocat`. |
{%- ifversion actions-oidc-custom-claims %}
| `GITHUB_REPOSITORY_OWNER_ID` | {% data reusables.actions.repository_owner_id-description %} |
{%- endif %}
| `GITHUB_RETENTION_DAYS` | The number of days that workflow run logs and artifacts are kept. For example, `90`. |
| `GITHUB_RUN_ATTEMPT` | A unique number for each attempt of a particular workflow run in a repository. This number begins at 1 for the workflow run's first attempt, and increments with each re-run. For example, `3`. |
| `GITHUB_RUN_ID` | {% data reusables.actions.run_id_description %} For example, `1658821493`. |
@ -267,6 +276,10 @@ We strongly recommend that actions use variables to access the filesystem rather
| `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/rob/runner/_layout/_work/_temp/_runner_file_commands/step_summary_1cb22d7f-5663-41a8-9ffc-13472605c76c`. For more information, see "[Workflow commands for {% data variables.product.prodname_actions %}](/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary)." |
{%- 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 %} |
| `GITHUB_WORKFLOW_SHA` | {% data reusables.actions.workflow-sha-description %} |
{%- endif %}
| `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`. |
{%- ifversion actions-runner-arch-envvars %}
| `RUNNER_ARCH` | {% data reusables.actions.runner-arch-description %} |

Просмотреть файл

@ -0,0 +1,7 @@
# Reference: #8927
# General versioning for new OIDC custom claims
versions:
fpt: '*'
ghec: '*'
ghes: '>=3.9'
ghae: '>=3.9'

Просмотреть файл

@ -0,0 +1 @@
The account ID of the person or app that triggered the initial workflow run. For example, `1234567`. Note that this is different from the actor username.

Просмотреть файл

@ -0,0 +1 @@
For jobs using a reusable workflow, the commit SHA for the reusable workflow file.

Просмотреть файл

@ -0,0 +1 @@
The ID of the repository. For example, `123456789`. Note that this is different from the repository name.

Просмотреть файл

@ -0,0 +1 @@
The repository owner's account ID. For example, `1234567`. Note that this is different from the owner's name.

Просмотреть файл

@ -0,0 +1 @@
The ref path to the workflow. For example, `octocat/hello-world/.github/workflows/my-workflow.yml@refs/heads/my_branch`.

Просмотреть файл

@ -0,0 +1 @@
The commit SHA for the workflow file.