Skip to content

Commit 066e076

Browse files
author
Edward Thomson
authored
Actions: runs.using can now specify node16 (#22911)
1 parent ae4675c commit 066e076

1 file changed

Lines changed: 16 additions & 9 deletions

File tree

content/actions/creating-actions/metadata-syntax-for-github-actions.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,15 @@ runs:
133133

134134
For more information on how to use context syntax, see "[Contexts](/actions/learn-github-actions/contexts)."
135135

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+
136140
## `runs` for JavaScript actions
137141

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.
139143

140-
### Example using Node.js
144+
### Example using Node.js v12
141145

142146
```yaml
143147
runs:
@@ -147,15 +151,18 @@ runs:
147151

148152
### `runs.using`
149153

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.
151158

152159
### `runs.main`
153160

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.
155162

156163
### `pre`
157164

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).
159166

160167
In this example, the `pre:` action runs a script called `setup.js`:
161168

@@ -181,7 +188,7 @@ In this example, `cleanup.js` only runs on Linux-based runners:
181188

182189
### `post`
183190

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.
185192

186193
In this example, the `post:` action runs a script called `cleanup.js`:
187194

@@ -207,11 +214,11 @@ For example, this `cleanup.js` will only run on Linux-based runners:
207214

208215
## `runs` for composite actions
209216

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.
211218

212219
### `runs.using`
213220

214-
**Required** To use a composite action, set this to `"composite"`.
221+
**Required** You must set this value to `'composite'`.
215222

216223
### `runs.steps`
217224

@@ -354,7 +361,7 @@ runs:
354361

355362
**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).
356363

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.
358365

359366
In this example, the `pre-entrypoint:` action runs a script called `setup.sh`:
360367

0 commit comments

Comments
 (0)