Skip to content

Commit 9524903

Browse files
authored
define node version used once (#20)
1 parent a95d213 commit 9524903

File tree

2 files changed

+56
-32
lines changed

2 files changed

+56
-32
lines changed

templates/.github/workflows/ci.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- master
77
pull_request:
88

9+
env:
10+
NODE_VERSION: '<%- nodeVersion %>'
11+
912
jobs:
1013
lint:
1114
name: Lint
@@ -16,7 +19,7 @@ jobs:
1619
fetch-depth: 1
1720
- uses: actions/setup-node@v2-beta
1821
with:
19-
node-version: '<%- nodeVersion %>'
22+
node-version: '${{ env.NODE_VERSION }}'
2023
- name: Get package manager's global cache path
2124
id: global-cache-dir-path
2225
run: echo "::set-output name=dir::$(<%
@@ -90,7 +93,7 @@ jobs:
9093
fetch-depth: 1
9194
- uses: actions/setup-node@v2-beta
9295
with:
93-
node-version: '<%- nodeVersion %>'
96+
node-version: '${{ env.NODE_VERSION }}'
9497
- name: Get package manager's global cache path
9598
id: global-cache-dir-path
9699
run: echo "::set-output name=dir::$(<%
@@ -164,7 +167,7 @@ jobs:
164167
fetch-depth: 1
165168
- uses: actions/setup-node@v2-beta
166169
with:
167-
node-version: '<%- nodeVersion %>'
170+
node-version: '${{ env.NODE_VERSION }}'
168171
- name: Get package manager's global cache path
169172
id: global-cache-dir-path
170173
run: echo "::set-output name=dir::$(<%
@@ -247,7 +250,7 @@ jobs:
247250
fetch-depth: 1
248251
- uses: actions/setup-node@v2-beta
249252
with:
250-
node-version: '<%- nodeVersion %>'
253+
node-version: '${{ env.NODE_VERSION }}'
251254
- name: Get package manager's global cache path
252255
id: global-cache-dir-path
253256
run: echo "::set-output name=dir::$(<%

tests/acceptance/__snapshots__/creates-github-actions.test.ts.snap

Lines changed: 49 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
- master
1010
pull_request:
1111
12+
env:
13+
NODE_VERSION: '6.x'
14+
1215
jobs:
1316
lint:
1417
name: Lint
@@ -19,7 +22,7 @@ jobs:
1922
fetch-depth: 1
2023
- uses: actions/setup-node@v2-beta
2124
with:
22-
node-version: '6.x'
25+
node-version: '\${{ env.NODE_VERSION }}'
2326
- name: Get package manager's global cache path
2427
id: global-cache-dir-path
2528
run: echo \\"::set-output name=dir::$(npm config get cache)\\"
@@ -63,7 +66,7 @@ jobs:
6366
fetch-depth: 1
6467
- uses: actions/setup-node@v2-beta
6568
with:
66-
node-version: '6.x'
69+
node-version: '\${{ env.NODE_VERSION }}'
6770
- name: Get package manager's global cache path
6871
id: global-cache-dir-path
6972
run: echo \\"::set-output name=dir::$(npm config get cache)\\"
@@ -107,7 +110,7 @@ jobs:
107110
fetch-depth: 1
108111
- uses: actions/setup-node@v2-beta
109112
with:
110-
node-version: '6.x'
113+
node-version: '\${{ env.NODE_VERSION }}'
111114
- name: Get package manager's global cache path
112115
id: global-cache-dir-path
113116
run: echo \\"::set-output name=dir::$(npm config get cache)\\"
@@ -162,7 +165,7 @@ jobs:
162165
fetch-depth: 1
163166
- uses: actions/setup-node@v2-beta
164167
with:
165-
node-version: '6.x'
168+
node-version: '\${{ env.NODE_VERSION }}'
166169
- name: Get package manager's global cache path
167170
id: global-cache-dir-path
168171
run: echo \\"::set-output name=dir::$(npm config get cache)\\"
@@ -203,6 +206,9 @@ on:
203206
- master
204207
pull_request:
205208
209+
env:
210+
NODE_VERSION: '8.x'
211+
206212
jobs:
207213
lint:
208214
name: Lint
@@ -213,7 +219,7 @@ jobs:
213219
fetch-depth: 1
214220
- uses: actions/setup-node@v2-beta
215221
with:
216-
node-version: '8.x'
222+
node-version: '\${{ env.NODE_VERSION }}'
217223
- name: Get package manager's global cache path
218224
id: global-cache-dir-path
219225
run: echo \\"::set-output name=dir::$(npm config get cache)\\"
@@ -257,7 +263,7 @@ jobs:
257263
fetch-depth: 1
258264
- uses: actions/setup-node@v2-beta
259265
with:
260-
node-version: '8.x'
266+
node-version: '\${{ env.NODE_VERSION }}'
261267
- name: Get package manager's global cache path
262268
id: global-cache-dir-path
263269
run: echo \\"::set-output name=dir::$(npm config get cache)\\"
@@ -301,7 +307,7 @@ jobs:
301307
fetch-depth: 1
302308
- uses: actions/setup-node@v2-beta
303309
with:
304-
node-version: '8.x'
310+
node-version: '\${{ env.NODE_VERSION }}'
305311
- name: Get package manager's global cache path
306312
id: global-cache-dir-path
307313
run: echo \\"::set-output name=dir::$(npm config get cache)\\"
@@ -356,7 +362,7 @@ jobs:
356362
fetch-depth: 1
357363
- uses: actions/setup-node@v2-beta
358364
with:
359-
node-version: '8.x'
365+
node-version: '\${{ env.NODE_VERSION }}'
360366
- name: Get package manager's global cache path
361367
id: global-cache-dir-path
362368
run: echo \\"::set-output name=dir::$(npm config get cache)\\"
@@ -397,6 +403,9 @@ on:
397403
- master
398404
pull_request:
399405
406+
env:
407+
NODE_VERSION: '6.x'
408+
400409
jobs:
401410
lint:
402411
name: Lint
@@ -407,7 +416,7 @@ jobs:
407416
fetch-depth: 1
408417
- uses: actions/setup-node@v2-beta
409418
with:
410-
node-version: '6.x'
419+
node-version: '\${{ env.NODE_VERSION }}'
411420
- name: Get package manager's global cache path
412421
id: global-cache-dir-path
413422
run: echo \\"::set-output name=dir::$(npm config get cache)\\"
@@ -451,7 +460,7 @@ jobs:
451460
fetch-depth: 1
452461
- uses: actions/setup-node@v2-beta
453462
with:
454-
node-version: '6.x'
463+
node-version: '\${{ env.NODE_VERSION }}'
455464
- name: Get package manager's global cache path
456465
id: global-cache-dir-path
457466
run: echo \\"::set-output name=dir::$(npm config get cache)\\"
@@ -495,7 +504,7 @@ jobs:
495504
fetch-depth: 1
496505
- uses: actions/setup-node@v2-beta
497506
with:
498-
node-version: '6.x'
507+
node-version: '\${{ env.NODE_VERSION }}'
499508
- name: Get package manager's global cache path
500509
id: global-cache-dir-path
501510
run: echo \\"::set-output name=dir::$(npm config get cache)\\"
@@ -550,7 +559,7 @@ jobs:
550559
fetch-depth: 1
551560
- uses: actions/setup-node@v2-beta
552561
with:
553-
node-version: '6.x'
562+
node-version: '\${{ env.NODE_VERSION }}'
554563
- name: Get package manager's global cache path
555564
id: global-cache-dir-path
556565
run: echo \\"::set-output name=dir::$(npm config get cache)\\"
@@ -591,6 +600,9 @@ on:
591600
- master
592601
pull_request:
593602
603+
env:
604+
NODE_VERSION: '10.x'
605+
594606
jobs:
595607
lint:
596608
name: Lint
@@ -601,7 +613,7 @@ jobs:
601613
fetch-depth: 1
602614
- uses: actions/setup-node@v2-beta
603615
with:
604-
node-version: '10.x'
616+
node-version: '\${{ env.NODE_VERSION }}'
605617
- name: Get package manager's global cache path
606618
id: global-cache-dir-path
607619
run: echo \\"::set-output name=dir::$(npm config get cache)\\"
@@ -645,7 +657,7 @@ jobs:
645657
fetch-depth: 1
646658
- uses: actions/setup-node@v2-beta
647659
with:
648-
node-version: '10.x'
660+
node-version: '\${{ env.NODE_VERSION }}'
649661
- name: Get package manager's global cache path
650662
id: global-cache-dir-path
651663
run: echo \\"::set-output name=dir::$(npm config get cache)\\"
@@ -689,7 +701,7 @@ jobs:
689701
fetch-depth: 1
690702
- uses: actions/setup-node@v2-beta
691703
with:
692-
node-version: '10.x'
704+
node-version: '\${{ env.NODE_VERSION }}'
693705
- name: Get package manager's global cache path
694706
id: global-cache-dir-path
695707
run: echo \\"::set-output name=dir::$(npm config get cache)\\"
@@ -745,7 +757,7 @@ jobs:
745757
fetch-depth: 1
746758
- uses: actions/setup-node@v2-beta
747759
with:
748-
node-version: '10.x'
760+
node-version: '\${{ env.NODE_VERSION }}'
749761
- name: Get package manager's global cache path
750762
id: global-cache-dir-path
751763
run: echo \\"::set-output name=dir::$(npm config get cache)\\"
@@ -786,6 +798,9 @@ on:
786798
- master
787799
pull_request:
788800
801+
env:
802+
NODE_VERSION: '10.x'
803+
789804
jobs:
790805
lint:
791806
name: Lint
@@ -796,7 +811,7 @@ jobs:
796811
fetch-depth: 1
797812
- uses: actions/setup-node@v2-beta
798813
with:
799-
node-version: '10.x'
814+
node-version: '\${{ env.NODE_VERSION }}'
800815
- name: Get package manager's global cache path
801816
id: global-cache-dir-path
802817
run: echo \\"::set-output name=dir::$(npm config get cache)\\"
@@ -840,7 +855,7 @@ jobs:
840855
fetch-depth: 1
841856
- uses: actions/setup-node@v2-beta
842857
with:
843-
node-version: '10.x'
858+
node-version: '\${{ env.NODE_VERSION }}'
844859
- name: Get package manager's global cache path
845860
id: global-cache-dir-path
846861
run: echo \\"::set-output name=dir::$(npm config get cache)\\"
@@ -884,7 +899,7 @@ jobs:
884899
fetch-depth: 1
885900
- uses: actions/setup-node@v2-beta
886901
with:
887-
node-version: '10.x'
902+
node-version: '\${{ env.NODE_VERSION }}'
888903
- name: Get package manager's global cache path
889904
id: global-cache-dir-path
890905
run: echo \\"::set-output name=dir::$(npm config get cache)\\"
@@ -940,7 +955,7 @@ jobs:
940955
fetch-depth: 1
941956
- uses: actions/setup-node@v2-beta
942957
with:
943-
node-version: '10.x'
958+
node-version: '\${{ env.NODE_VERSION }}'
944959
- name: Get package manager's global cache path
945960
id: global-cache-dir-path
946961
run: echo \\"::set-output name=dir::$(npm config get cache)\\"
@@ -981,6 +996,9 @@ on:
981996
- master
982997
pull_request:
983998
999+
env:
1000+
NODE_VERSION: '10.x'
1001+
9841002
jobs:
9851003
lint:
9861004
name: Lint
@@ -991,7 +1009,7 @@ jobs:
9911009
fetch-depth: 1
9921010
- uses: actions/setup-node@v2-beta
9931011
with:
994-
node-version: '10.x'
1012+
node-version: '\${{ env.NODE_VERSION }}'
9951013
- name: Get package manager's global cache path
9961014
id: global-cache-dir-path
9971015
run: echo \\"::set-output name=dir::$(yarn cache dir)\\"
@@ -1035,7 +1053,7 @@ jobs:
10351053
fetch-depth: 1
10361054
- uses: actions/setup-node@v2-beta
10371055
with:
1038-
node-version: '10.x'
1056+
node-version: '\${{ env.NODE_VERSION }}'
10391057
- name: Get package manager's global cache path
10401058
id: global-cache-dir-path
10411059
run: echo \\"::set-output name=dir::$(yarn cache dir)\\"
@@ -1079,7 +1097,7 @@ jobs:
10791097
fetch-depth: 1
10801098
- uses: actions/setup-node@v2-beta
10811099
with:
1082-
node-version: '10.x'
1100+
node-version: '\${{ env.NODE_VERSION }}'
10831101
- name: Get package manager's global cache path
10841102
id: global-cache-dir-path
10851103
run: echo \\"::set-output name=dir::$(yarn cache dir)\\"
@@ -1136,7 +1154,7 @@ jobs:
11361154
fetch-depth: 1
11371155
- uses: actions/setup-node@v2-beta
11381156
with:
1139-
node-version: '10.x'
1157+
node-version: '\${{ env.NODE_VERSION }}'
11401158
- name: Get package manager's global cache path
11411159
id: global-cache-dir-path
11421160
run: echo \\"::set-output name=dir::$(yarn cache dir)\\"
@@ -1177,6 +1195,9 @@ on:
11771195
- master
11781196
pull_request:
11791197
1198+
env:
1199+
NODE_VERSION: '10.x'
1200+
11801201
jobs:
11811202
lint:
11821203
name: Lint
@@ -1187,7 +1208,7 @@ jobs:
11871208
fetch-depth: 1
11881209
- uses: actions/setup-node@v2-beta
11891210
with:
1190-
node-version: '10.x'
1211+
node-version: '\${{ env.NODE_VERSION }}'
11911212
- name: Get package manager's global cache path
11921213
id: global-cache-dir-path
11931214
run: echo \\"::set-output name=dir::$(yarn cache dir)\\"
@@ -1231,7 +1252,7 @@ jobs:
12311252
fetch-depth: 1
12321253
- uses: actions/setup-node@v2-beta
12331254
with:
1234-
node-version: '10.x'
1255+
node-version: '\${{ env.NODE_VERSION }}'
12351256
- name: Get package manager's global cache path
12361257
id: global-cache-dir-path
12371258
run: echo \\"::set-output name=dir::$(yarn cache dir)\\"
@@ -1275,7 +1296,7 @@ jobs:
12751296
fetch-depth: 1
12761297
- uses: actions/setup-node@v2-beta
12771298
with:
1278-
node-version: '10.x'
1299+
node-version: '\${{ env.NODE_VERSION }}'
12791300
- name: Get package manager's global cache path
12801301
id: global-cache-dir-path
12811302
run: echo \\"::set-output name=dir::$(yarn cache dir)\\"
@@ -1333,7 +1354,7 @@ jobs:
13331354
fetch-depth: 1
13341355
- uses: actions/setup-node@v2-beta
13351356
with:
1336-
node-version: '10.x'
1357+
node-version: '\${{ env.NODE_VERSION }}'
13371358
- name: Get package manager's global cache path
13381359
id: global-cache-dir-path
13391360
run: echo \\"::set-output name=dir::$(yarn cache dir)\\"

0 commit comments

Comments
 (0)