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/creating-actions/metadata-syntax-for-github-actions.md
+16-9Lines changed: 16 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,11 +133,15 @@ runs:
133
133
134
134
For more information on how to use context syntax, see "[Contexts](/actions/learn-github-actions/contexts)."
135
135
136
+
## `runs`
137
+
138
+
**Required** Specifies whether this is a JavaScript action, a composite action or a Docker action and how the action is executed.
139
+
136
140
## `runs` for JavaScript actions
137
141
138
-
**Required** Configures the path to the action's code and the application used to execute the code.
142
+
**Required** Configures the path to the action's code and the runtime used to execute the code.
139
143
140
-
### Example using Node.js
144
+
### Example using Node.js v12
141
145
142
146
```yaml
143
147
runs:
@@ -147,15 +151,18 @@ runs:
147
151
148
152
### `runs.using`
149
153
150
-
**Required** The application used to execute the code specified in [`main`](#runsmain).
154
+
**Required** The runtime used to execute the code specified in [`main`](#runsmain).
155
+
156
+
- Use `node12` for Node.js v12.
157
+
- Use `node16` for Node.js v16.
151
158
152
159
### `runs.main`
153
160
154
-
**Required** The file that contains your action code. The application specified in [`using`](#runsusing) executes this file.
161
+
**Required** The file that contains your action code. The runtime specified in [`using`](#runsusing) executes this file.
155
162
156
163
### `pre`
157
164
158
-
**Optional** Allows you to run a script at the start of a job, before the `main:` action begins. For example, you can use `pre:` to run a prerequisite setup script. The application specified with the [`using`](#runsusing) syntax will execute this file. The `pre:` action always runs by default but you can override this using [`pre-if`](#pre-if).
165
+
**Optional** Allows you to run a script at the start of a job, before the `main:` action begins. For example, you can use `pre:` to run a prerequisite setup script. The runtime specified with the [`using`](#runsusing) syntax will execute this file. The `pre:` action always runs by default but you can override this using [`pre-if`](#pre-if).
159
166
160
167
In this example, the `pre:` action runs a script called `setup.js`:
161
168
@@ -181,7 +188,7 @@ In this example, `cleanup.js` only runs on Linux-based runners:
181
188
182
189
### `post`
183
190
184
-
**Optional** Allows you to run a script at the end of a job, once the `main:` action has completed. For example, you can use `post:` to terminate certain processes or remove unneeded files. The application specified with the [`using`](#runsusing) syntax will execute this file.
191
+
**Optional** Allows you to run a script at the end of a job, once the `main:` action has completed. For example, you can use `post:` to terminate certain processes or remove unneeded files. The runtime specified with the [`using`](#runsusing) syntax will execute this file.
185
192
186
193
In this example, the `post:` action runs a script called `cleanup.js`:
187
194
@@ -207,11 +214,11 @@ For example, this `cleanup.js` will only run on Linux-based runners:
207
214
208
215
## `runs` for composite actions
209
216
210
-
**Required** Configures the path to the composite action, and the application used to execute the code.
217
+
**Required** Configures the path to the composite action.
211
218
212
219
### `runs.using`
213
220
214
-
**Required** To use a composite action, set this to `"composite"`.
221
+
**Required** You must set this value to `'composite'`.
215
222
216
223
### `runs.steps`
217
224
@@ -354,7 +361,7 @@ runs:
354
361
355
362
**Optional** Allows you to run a script before the `entrypoint` action begins. For example, you can use `pre-entrypoint:` to run a prerequisite setup script. {% data variables.product.prodname_actions %} uses `docker run` to launch this action, and runs the script inside a new container that uses the same base image. This means that the runtime state is different from the main `entrypoint` container, and any states you require must be accessed in either the workspace, `HOME`, or as a `STATE_` variable. The `pre-entrypoint:` action always runs by default but you can override this using [`pre-if`](#pre-if).
356
363
357
-
The application specified with the [`using`](#runsusing) syntax will execute this file.
364
+
The runtime specified with the [`using`](#runsusing) syntax will execute this file.
358
365
359
366
In this example, the `pre-entrypoint:` action runs a script called `setup.sh`:
0 commit comments