You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/actions/reference/context-and-expression-syntax-for-github-actions.md
+16-16Lines changed: 16 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -84,24 +84,24 @@ The `github` context contains information about the workflow run and the event t
84
84
| Property name | Type | Description |
85
85
|---------------|------|-------------|
86
86
| `github` | `object` | The top-level context available during any job or step in a workflow. |
87
+
| `github.action` | `string` | The name of the action currently running. {% data variables.product.prodname_dotcom %} removes special characters or uses the name `run` when the current step runs a script. If you use the same action more than once in the same job, the name will include a suffix with the sequence number. For example, the first script you run will have the name `run1`, and the second script will be named `run2`. Similarly, the second invocation of `actions/checkout` will be `actionscheckout2`. |
88
+
| `github.action_path` | `string` | The path where your action is located. You can use this path to easily access files located in the same repository as your action. This attribute is only supported in composite run steps actions. |
89
+
| `github.actor` | `string` | The login of the user that initiated the workflow run. |
90
+
| `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 a `pull_request`. |
87
91
| `github.event` | `object` | The full event webhook payload. For more information, see "[Events that trigger workflows](/articles/events-that-trigger-workflows/)." You can access individual properties of the event using this context. |
92
+
| `github.event_name` | `string` | The name of the event that triggered the workflow run. |
88
93
| `github.event_path` | `string` | The path to the full event webhook payload on the runner. |
89
-
| `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. |
94
+
| `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 a `pull_request`. |
90
95
| `github.job` | `string` | The [`job_id`](/actions/reference/workflow-syntax-for-github-actions#jobsjob_id) of the current job. |
91
-
| `github.run_id` | `string` | {% data reusables.github-actions.run_id_description %} |
92
-
| `github.run_number` | `string` | {% data reusables.github-actions.run_number_description %} |
93
-
| `github.actor` | `string` | The login of the user that initiated the workflow run. |
96
+
| `github.ref` | `string` | The branch or tag ref that triggered the workflow run. |
94
97
| `github.repository` | `string` | The owner and repository name. For example, `Codertocat/Hello-World`. |
95
98
| `github.repository_owner` | `string` | The repository owner's name. For example, `Codertocat`. |
96
-
| `github.event_name` | `string` | The name of the event that triggered the workflow run. |
99
+
| `github.run_id` | `string` | {% data reusables.github-actions.run_id_description %} |
100
+
| `github.run_number` | `string` | {% data reusables.github-actions.run_number_description %} |
97
101
| `github.sha` | `string` | The commit SHA that triggered the workflow run. |
98
-
| `github.ref` | `string` | The branch or tag ref that triggered the workflow run. |
99
-
| `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 a `pull_request`. |
100
-
| `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 a `pull_request`. |
101
102
| `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 "[Authenticating with the GITHUB_TOKEN](/actions/automating-your-workflow-with-github-actions/authenticating-with-the-github_token)." |
103
+
| `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. |
102
104
| `github.workspace` | `string` | The default working directory for steps and the default location of your repository when using the [`checkout`](https://github.com/actions/checkout) action. |
103
-
| `github.action` | `string` | The name of the action currently running. {% data variables.product.prodname_dotcom %} removes special characters or uses the name `run` when the current step runs a script. If you use the same action more than once in the same job, the name will include a suffix with the sequence number. For example, the first script you run will have the name `run1`, and the second script will be named `run2`. Similarly, the second invocation of `actions/checkout` will be `actionscheckout2`. |
104
-
| `github.action_path` | `string` | The path where your action is located. You can use this path to easily access files located in the same repository as your action. This attribute is only supported in composite run steps actions.
105
105
106
106
#### **`env` context**
107
107
@@ -124,14 +124,14 @@ The `job` context contains information about the currently running job.
124
124
| Property name | Type | Description |
125
125
|---------------|------|-------------|
126
126
| `job` | `object` | This context changes for each job in a workflow run. You can access this context from any step in a job. |
127
-
| `job.status` | `string` | The current status of the job. Possible values are `success`, `failure`, or `cancelled`. |
128
127
| `job.container` | `object` | Information about the job's container. For more information about containers, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/articles/workflow-syntax-for-github-actions#jobsjob_idcontainer)." |
129
-
| `job.container.network` | `string` | The id of the container network. The runner creates the network used by all containers in a job. |
130
128
| `job.container.id` | `string` | The id of the container. |
129
+
| `job.container.network` | `string` | The id of the container network. The runner creates the network used by all containers in a job. |
131
130
| `job.services` | `object` | The service containers created for a job. For more information about service containers, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/articles/workflow-syntax-for-github-actions#jobsjob_idservices)." |
132
131
| `job.services.<service id>.id` | `string` | The id of the service container. |
133
-
| `job.services.<service id>.ports` | `object` | The exposed ports of the service container. |
134
132
| `job.services.<service id>.network` | `string` | The id of the service container network. The runner creates the network used by all containers in a job. |
133
+
| `job.services.<service id>.ports` | `object` | The exposed ports of the service container. |
134
+
| `job.status` | `string` | The current status of the job. Possible values are `success`, `failure`, or `cancelled`. |
135
135
136
136
#### **`steps` context**
137
137
@@ -141,9 +141,9 @@ The `steps` context contains information about the steps in the current job that
141
141
|---------------|------|-------------|
142
142
| `steps` | `object` | This context changes for each step in a job. You can access this context from any step in a job. |
143
143
| `steps.<step id>.outputs` | `object` | The set of outputs defined for the step. For more information, see "[Metadata syntax for {% data variables.product.prodname_actions %}](/articles/metadata-syntax-for-github-actions#outputs)." |
144
-
| `steps.<step id>.outputs.<output name>` | `string` | The value of a specific output. |
145
-
| `steps.<step id>.outcome` | `string` | The result of a completed step before [`continue-on-error`](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error) is applied. Possible values are `success`, `failure`, `cancelled`, or `skipped`. When a `continue-on-error` step fails, the `outcome` is `failure`, but the final `conclusion` is `success`. |
146
144
| `steps.<step id>.conclusion` | `string` | The result of a completed step after [`continue-on-error`](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error) is applied. Possible values are `success`, `failure`, `cancelled`, or `skipped`. When a `continue-on-error` step fails, the `outcome` is `failure`, but the final `conclusion` is `success`. |
145
+
| `steps.<step id>.outcome` | `string` | The result of a completed step before [`continue-on-error`](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error) is applied. Possible values are `success`, `failure`, `cancelled`, or `skipped`. When a `continue-on-error` step fails, the `outcome` is `failure`, but the final `conclusion` is `success`. |
146
+
| `steps.<step id>.outputs.<output name>` | `string` | The value of a specific output. |
147
147
148
148
#### **`runner` context**
149
149
@@ -162,9 +162,9 @@ The `needs` context contains outputs from all jobs that are defined as a depende
162
162
| Property name | Type | Description |
163
163
|---------------|------|-------------|
164
164
| `needs.<job id>` | `object` | A single job that the current job depends on. |
165
-
| `needs.<job id>.result` | `string` | The result of a job that the current job depends on. Possible values are `success`, `failure`, or `cancelled`. |
166
165
| `needs.<job id>.outputs` | `object` | The set of outputs of a job that the current job depends on. |
167
166
| `needs.<job id>.outputs.<output name>` | `string` | The value of a specific output for a job that the current job depends on. |
167
+
| `needs.<job id>.result` | `string` | The result of a job that the current job depends on. Possible values are `success`, `failure`, or `cancelled`. |
168
168
169
169
#### Example printing context information to the log file
0 commit comments