Skip to content

Commit 0b80f53

Browse files
Update workflow-syntax-for-github-actions.md (#5286)
1 parent c89c66b commit 0b80f53

1 file changed

Lines changed: 21 additions & 21 deletions

File tree

content/actions/reference/workflow-syntax-for-github-actions.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -899,18 +899,18 @@ The order that you define a `matrix` matters. The first option you define will b
899899

900900
#### Example running with more than one version of Node.js
901901

902-
You can specify a matrix by supplying an array for the configuration options. For example, if the runner supports Node.js versions 6, 8, and 10, you could specify an array of those versions in the `matrix`.
902+
You can specify a matrix by supplying an array for the configuration options. For example, if the runner supports Node.js versions 10, 12, and 14, you could specify an array of those versions in the `matrix`.
903903

904904
This example creates a matrix of three jobs by setting the `node` key to an array of three Node.js versions. To use the matrix, the example sets the `matrix.node` context property as the value of the `setup-node` action's input parameter `node-version`. As a result, three jobs will run, each using a different Node.js version.
905905

906906
{% raw %}
907907
```yaml
908908
strategy:
909909
matrix:
910-
node: [6, 8, 10]
910+
node: [10, 12, 14]
911911
steps:
912912
# Configures the node version used on GitHub-hosted runners
913-
- uses: actions/setup-node@v1
913+
- uses: actions/setup-node@v2
914914
with:
915915
# The Node.js version to configure
916916
node-version: ${{ matrix.node }}
@@ -934,9 +934,9 @@ runs-on: ${{ matrix.os }}
934934
strategy:
935935
matrix:
936936
os: [ubuntu-16.04, ubuntu-18.04]
937-
node: [6, 8, 10]
937+
node: [10, 12, 14]
938938
steps:
939-
- uses: actions/setup-node@v1
939+
- uses: actions/setup-node@v2
940940
with:
941941
node-version: ${{ matrix.node }}
942942
```
@@ -948,37 +948,37 @@ steps:
948948

949949
#### Example including additional values into combinations
950950

951-
You can add additional configuration options to a build matrix job that already exists. For example, if you want to use a specific version of `npm` when the job that uses `windows-latest` and version 4 of `node` runs, you can use `include` to specify that additional option.
951+
You can add additional configuration options to a build matrix job that already exists. For example, if you want to use a specific version of `npm` when the job that uses `windows-latest` and version 8 of `node` runs, you can use `include` to specify that additional option.
952952

953953
{% raw %}
954954
```yaml
955955
runs-on: ${{ matrix.os }}
956956
strategy:
957957
matrix:
958958
os: [macos-latest, windows-latest, ubuntu-18.04]
959-
node: [4, 6, 8, 10]
959+
node: [8, 10, 12, 14]
960960
include:
961-
# includes a new variable of npm with a value of 2
961+
# includes a new variable of npm with a value of 6
962962
# for the matrix leg matching the os and version
963963
- os: windows-latest
964-
node: 4
965-
npm: 2
964+
node: 8
965+
npm: 6
966966
```
967967
{% endraw %}
968968

969969
#### Example including new combinations
970970

971-
You can use `include` to add new jobs to a build matrix. Any unmatched include configurations are added to the matrix. For example, if you want to use `node` version 12 to build on multiple operating systems, but wanted one extra experimental job using node version 13 on Ubuntu, you can use `include` to specify that additional job.
971+
You can use `include` to add new jobs to a build matrix. Any unmatched include configurations are added to the matrix. For example, if you want to use `node` version 14 to build on multiple operating systems, but wanted one extra experimental job using node version 15 on Ubuntu, you can use `include` to specify that additional job.
972972

973973
{% raw %}
974974
```yaml
975975
runs-on: ${{ matrix.os }}
976976
strategy:
977977
matrix:
978-
node: [12]
978+
node: [14]
979979
os: [macos-latest, windows-latest, ubuntu-18.04]
980980
include:
981-
- node: 13
981+
- node: 15
982982
os: ubuntu-18.04
983983
experimental: true
984984
```
@@ -994,11 +994,11 @@ runs-on: ${{ matrix.os }}
994994
strategy:
995995
matrix:
996996
os: [macos-latest, windows-latest, ubuntu-18.04]
997-
node: [4, 6, 8, 10]
997+
node: [8, 10, 12, 14]
998998
exclude:
999-
# excludes node 4 on macOS
999+
# excludes node 8 on macOS
10001000
- os: macos-latest
1001-
node: 4
1001+
node: 8
10021002
```
10031003
{% endraw %}
10041004

@@ -1033,7 +1033,7 @@ Prevents a workflow run from failing when a job fails. Set to `true` to allow a
10331033

10341034
#### Example preventing a specific failing matrix job from failing a workflow run
10351035

1036-
You can allow specific jobs in a job matrix to fail without failing the workflow run. For example, if you wanted to only allow an experimental job with `node` set to `13` to fail without failing the workflow run.
1036+
You can allow specific jobs in a job matrix to fail without failing the workflow run. For example, if you wanted to only allow an experimental job with `node` set to `15` to fail without failing the workflow run.
10371037

10381038
{% raw %}
10391039
```yaml
@@ -1042,11 +1042,11 @@ continue-on-error: ${{ matrix.experimental }}
10421042
strategy:
10431043
fail-fast: false
10441044
matrix:
1045-
node: [11, 12]
1045+
node: [13, 14]
10461046
os: [macos-latest, ubuntu-18.04]
10471047
experimental: [false]
10481048
include:
1049-
- node: 13
1049+
- node: 15
10501050
os: ubuntu-18.04
10511051
experimental: true
10521052
```
@@ -1064,7 +1064,7 @@ If you do not set a `container`, all steps will run directly on the host specifi
10641064
jobs:
10651065
my_job:
10661066
container:
1067-
image: node:10.16-jessie
1067+
image: node:14.16
10681068
env:
10691069
NODE_ENV: development
10701070
ports:
@@ -1079,7 +1079,7 @@ When you only specify a container image, you can omit the `image` keyword.
10791079
```yaml
10801080
jobs:
10811081
my_job:
1082-
container: node:10.16-jessie
1082+
container: node:14.16
10831083
```
10841084

10851085
### `jobs.<job_id>.container.image`

0 commit comments

Comments
 (0)