Skip to content
This repository was archived by the owner on May 4, 2024. It is now read-only.

Commit 9815e70

Browse files
committed
chore: postinstall for dependabot template-oss PR
1 parent 46c9b90 commit 9815e70

File tree

7 files changed

+399
-31
lines changed

7 files changed

+399
-31
lines changed

.github/workflows/audit.yml

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,54 @@ jobs:
2525
git config --global user.name "npm CLI robot"
2626
- name: Setup Node
2727
uses: actions/setup-node@v3
28+
id: node
2829
with:
2930
node-version: 18.x
30-
- name: Install npm@next-9
31-
run: npm i --prefer-online --no-fund --no-audit -g npm@next-9
31+
check-latest: contains('18.x', '.x')
32+
33+
# node 10/12/14 ship with npm@6, which is known to fail when updating itself in windows
34+
- name: Update Windows npm
35+
if: |
36+
matrix.platform.os == 'windows-latest' && (
37+
startsWith(steps.node.outputs.node-version, 'v10.') || startsWith(steps.node.outputs.node-version, 'v12.') || startsWith(steps.node.outputs.node-version, 'v14.')
38+
)
39+
run: |
40+
curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
41+
tar xf npm-7.5.4.tgz
42+
cd package
43+
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
44+
cd ..
45+
rmdir /s /q package
46+
47+
# Start on Node 10 because we dont test on anything lower
48+
- name: Install npm@7 on Node 10
49+
shell: bash
50+
if: startsWith(steps.node.outputs.node-version, 'v10.')
51+
id: npm-7
52+
run: |
53+
npm i --prefer-online --no-fund --no-audit -g npm@7
54+
echo "updated=true" >> "$GITHUB_OUTPUT"
55+
56+
- name: Install npm@8 on Node 12
57+
shell: bash
58+
if: startsWith(steps.node.outputs.node-version, 'v12.')
59+
id: npm-8
60+
run: |
61+
npm i --prefer-online --no-fund --no-audit -g npm@8
62+
echo "updated=true" >> "$GITHUB_OUTPUT"
63+
64+
- name: Install npm@9 on Node 14/16/18.0
65+
shell: bash
66+
if: startsWith(steps.node.outputs.node-version, 'v14.') || startsWith(steps.node.outputs.node-version, 'v16.') || startsWith(steps.node.outputs.node-version, 'v18.0.')
67+
id: npm-9
68+
run: |
69+
npm i --prefer-online --no-fund --no-audit -g npm@9
70+
echo "updated=true" >> "$GITHUB_OUTPUT"
71+
72+
- name: Install npm@latest on Node
73+
if: ${{ !(steps.npm-7.outputs.updated || steps.npm-8.outputs.updated || steps.npm-9.outputs.updated) }}
74+
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
75+
3276
- name: npm Version
3377
run: npm -v
3478
- name: Install Dependencies

.github/workflows/ci-release.yml

Lines changed: 84 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,54 @@ jobs:
8080
git config --global user.name "npm CLI robot"
8181
- name: Setup Node
8282
uses: actions/setup-node@v3
83+
id: node
8384
with:
8485
node-version: 18.x
85-
- name: Install npm@next-9
86-
run: npm i --prefer-online --no-fund --no-audit -g npm@next-9
86+
check-latest: contains('18.x', '.x')
87+
88+
# node 10/12/14 ship with npm@6, which is known to fail when updating itself in windows
89+
- name: Update Windows npm
90+
if: |
91+
matrix.platform.os == 'windows-latest' && (
92+
startsWith(steps.node.outputs.node-version, 'v10.') || startsWith(steps.node.outputs.node-version, 'v12.') || startsWith(steps.node.outputs.node-version, 'v14.')
93+
)
94+
run: |
95+
curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
96+
tar xf npm-7.5.4.tgz
97+
cd package
98+
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
99+
cd ..
100+
rmdir /s /q package
101+
102+
# Start on Node 10 because we dont test on anything lower
103+
- name: Install npm@7 on Node 10
104+
shell: bash
105+
if: startsWith(steps.node.outputs.node-version, 'v10.')
106+
id: npm-7
107+
run: |
108+
npm i --prefer-online --no-fund --no-audit -g npm@7
109+
echo "updated=true" >> "$GITHUB_OUTPUT"
110+
111+
- name: Install npm@8 on Node 12
112+
shell: bash
113+
if: startsWith(steps.node.outputs.node-version, 'v12.')
114+
id: npm-8
115+
run: |
116+
npm i --prefer-online --no-fund --no-audit -g npm@8
117+
echo "updated=true" >> "$GITHUB_OUTPUT"
118+
119+
- name: Install npm@9 on Node 14/16/18.0
120+
shell: bash
121+
if: startsWith(steps.node.outputs.node-version, 'v14.') || startsWith(steps.node.outputs.node-version, 'v16.') || startsWith(steps.node.outputs.node-version, 'v18.0.')
122+
id: npm-9
123+
run: |
124+
npm i --prefer-online --no-fund --no-audit -g npm@9
125+
echo "updated=true" >> "$GITHUB_OUTPUT"
126+
127+
- name: Install npm@latest on Node
128+
if: ${{ !(steps.npm-7.outputs.updated || steps.npm-8.outputs.updated || steps.npm-9.outputs.updated) }}
129+
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
130+
87131
- name: npm Version
88132
run: npm -v
89133
- name: Install Dependencies
@@ -179,24 +223,54 @@ jobs:
179223
git config --global user.name "npm CLI robot"
180224
- name: Setup Node
181225
uses: actions/setup-node@v3
226+
id: node
182227
with:
183228
node-version: ${{ matrix.node-version }}
229+
check-latest: contains(matrix.node-version, '.x')
230+
231+
# node 10/12/14 ship with npm@6, which is known to fail when updating itself in windows
184232
- name: Update Windows npm
185-
# node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
186-
if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12.') || startsWith(matrix.node-version, '14.'))
233+
if: |
234+
matrix.platform.os == 'windows-latest' && (
235+
startsWith(steps.node.outputs.node-version, 'v10.') || startsWith(steps.node.outputs.node-version, 'v12.') || startsWith(steps.node.outputs.node-version, 'v14.')
236+
)
187237
run: |
188238
curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
189239
tar xf npm-7.5.4.tgz
190240
cd package
191241
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
192242
cd ..
193243
rmdir /s /q package
194-
- name: Install npm@7
195-
if: startsWith(matrix.node-version, '10.')
196-
run: npm i --prefer-online --no-fund --no-audit -g npm@7
197-
- name: Install npm@next-9
198-
if: ${{ !startsWith(matrix.node-version, '10.') }}
199-
run: npm i --prefer-online --no-fund --no-audit -g npm@next-9
244+
245+
# Start on Node 10 because we dont test on anything lower
246+
- name: Install npm@7 on Node 10
247+
shell: bash
248+
if: startsWith(steps.node.outputs.node-version, 'v10.')
249+
id: npm-7
250+
run: |
251+
npm i --prefer-online --no-fund --no-audit -g npm@7
252+
echo "updated=true" >> "$GITHUB_OUTPUT"
253+
254+
- name: Install npm@8 on Node 12
255+
shell: bash
256+
if: startsWith(steps.node.outputs.node-version, 'v12.')
257+
id: npm-8
258+
run: |
259+
npm i --prefer-online --no-fund --no-audit -g npm@8
260+
echo "updated=true" >> "$GITHUB_OUTPUT"
261+
262+
- name: Install npm@9 on Node 14/16/18.0
263+
shell: bash
264+
if: startsWith(steps.node.outputs.node-version, 'v14.') || startsWith(steps.node.outputs.node-version, 'v16.') || startsWith(steps.node.outputs.node-version, 'v18.0.')
265+
id: npm-9
266+
run: |
267+
npm i --prefer-online --no-fund --no-audit -g npm@9
268+
echo "updated=true" >> "$GITHUB_OUTPUT"
269+
270+
- name: Install npm@latest on Node
271+
if: ${{ !(steps.npm-7.outputs.updated || steps.npm-8.outputs.updated || steps.npm-9.outputs.updated) }}
272+
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
273+
200274
- name: npm Version
201275
run: npm -v
202276
- name: Install Dependencies

.github/workflows/ci.yml

Lines changed: 84 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,54 @@ jobs:
2929
git config --global user.name "npm CLI robot"
3030
- name: Setup Node
3131
uses: actions/setup-node@v3
32+
id: node
3233
with:
3334
node-version: 18.x
34-
- name: Install npm@next-9
35-
run: npm i --prefer-online --no-fund --no-audit -g npm@next-9
35+
check-latest: contains('18.x', '.x')
36+
37+
# node 10/12/14 ship with npm@6, which is known to fail when updating itself in windows
38+
- name: Update Windows npm
39+
if: |
40+
matrix.platform.os == 'windows-latest' && (
41+
startsWith(steps.node.outputs.node-version, 'v10.') || startsWith(steps.node.outputs.node-version, 'v12.') || startsWith(steps.node.outputs.node-version, 'v14.')
42+
)
43+
run: |
44+
curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
45+
tar xf npm-7.5.4.tgz
46+
cd package
47+
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
48+
cd ..
49+
rmdir /s /q package
50+
51+
# Start on Node 10 because we dont test on anything lower
52+
- name: Install npm@7 on Node 10
53+
shell: bash
54+
if: startsWith(steps.node.outputs.node-version, 'v10.')
55+
id: npm-7
56+
run: |
57+
npm i --prefer-online --no-fund --no-audit -g npm@7
58+
echo "updated=true" >> "$GITHUB_OUTPUT"
59+
60+
- name: Install npm@8 on Node 12
61+
shell: bash
62+
if: startsWith(steps.node.outputs.node-version, 'v12.')
63+
id: npm-8
64+
run: |
65+
npm i --prefer-online --no-fund --no-audit -g npm@8
66+
echo "updated=true" >> "$GITHUB_OUTPUT"
67+
68+
- name: Install npm@9 on Node 14/16/18.0
69+
shell: bash
70+
if: startsWith(steps.node.outputs.node-version, 'v14.') || startsWith(steps.node.outputs.node-version, 'v16.') || startsWith(steps.node.outputs.node-version, 'v18.0.')
71+
id: npm-9
72+
run: |
73+
npm i --prefer-online --no-fund --no-audit -g npm@9
74+
echo "updated=true" >> "$GITHUB_OUTPUT"
75+
76+
- name: Install npm@latest on Node
77+
if: ${{ !(steps.npm-7.outputs.updated || steps.npm-8.outputs.updated || steps.npm-9.outputs.updated) }}
78+
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
79+
3680
- name: npm Version
3781
run: npm -v
3882
- name: Install Dependencies
@@ -76,24 +120,54 @@ jobs:
76120
git config --global user.name "npm CLI robot"
77121
- name: Setup Node
78122
uses: actions/setup-node@v3
123+
id: node
79124
with:
80125
node-version: ${{ matrix.node-version }}
126+
check-latest: contains(matrix.node-version, '.x')
127+
128+
# node 10/12/14 ship with npm@6, which is known to fail when updating itself in windows
81129
- name: Update Windows npm
82-
# node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
83-
if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12.') || startsWith(matrix.node-version, '14.'))
130+
if: |
131+
matrix.platform.os == 'windows-latest' && (
132+
startsWith(steps.node.outputs.node-version, 'v10.') || startsWith(steps.node.outputs.node-version, 'v12.') || startsWith(steps.node.outputs.node-version, 'v14.')
133+
)
84134
run: |
85135
curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
86136
tar xf npm-7.5.4.tgz
87137
cd package
88138
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
89139
cd ..
90140
rmdir /s /q package
91-
- name: Install npm@7
92-
if: startsWith(matrix.node-version, '10.')
93-
run: npm i --prefer-online --no-fund --no-audit -g npm@7
94-
- name: Install npm@next-9
95-
if: ${{ !startsWith(matrix.node-version, '10.') }}
96-
run: npm i --prefer-online --no-fund --no-audit -g npm@next-9
141+
142+
# Start on Node 10 because we dont test on anything lower
143+
- name: Install npm@7 on Node 10
144+
shell: bash
145+
if: startsWith(steps.node.outputs.node-version, 'v10.')
146+
id: npm-7
147+
run: |
148+
npm i --prefer-online --no-fund --no-audit -g npm@7
149+
echo "updated=true" >> "$GITHUB_OUTPUT"
150+
151+
- name: Install npm@8 on Node 12
152+
shell: bash
153+
if: startsWith(steps.node.outputs.node-version, 'v12.')
154+
id: npm-8
155+
run: |
156+
npm i --prefer-online --no-fund --no-audit -g npm@8
157+
echo "updated=true" >> "$GITHUB_OUTPUT"
158+
159+
- name: Install npm@9 on Node 14/16/18.0
160+
shell: bash
161+
if: startsWith(steps.node.outputs.node-version, 'v14.') || startsWith(steps.node.outputs.node-version, 'v16.') || startsWith(steps.node.outputs.node-version, 'v18.0.')
162+
id: npm-9
163+
run: |
164+
npm i --prefer-online --no-fund --no-audit -g npm@9
165+
echo "updated=true" >> "$GITHUB_OUTPUT"
166+
167+
- name: Install npm@latest on Node
168+
if: ${{ !(steps.npm-7.outputs.updated || steps.npm-8.outputs.updated || steps.npm-9.outputs.updated) }}
169+
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
170+
97171
- name: npm Version
98172
run: npm -v
99173
- name: Install Dependencies

.github/workflows/post-dependabot.yml

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,54 @@ jobs:
2626
git config --global user.name "npm CLI robot"
2727
- name: Setup Node
2828
uses: actions/setup-node@v3
29+
id: node
2930
with:
3031
node-version: 18.x
31-
- name: Install npm@next-9
32-
run: npm i --prefer-online --no-fund --no-audit -g npm@next-9
32+
check-latest: contains('18.x', '.x')
33+
34+
# node 10/12/14 ship with npm@6, which is known to fail when updating itself in windows
35+
- name: Update Windows npm
36+
if: |
37+
matrix.platform.os == 'windows-latest' && (
38+
startsWith(steps.node.outputs.node-version, 'v10.') || startsWith(steps.node.outputs.node-version, 'v12.') || startsWith(steps.node.outputs.node-version, 'v14.')
39+
)
40+
run: |
41+
curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
42+
tar xf npm-7.5.4.tgz
43+
cd package
44+
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
45+
cd ..
46+
rmdir /s /q package
47+
48+
# Start on Node 10 because we dont test on anything lower
49+
- name: Install npm@7 on Node 10
50+
shell: bash
51+
if: startsWith(steps.node.outputs.node-version, 'v10.')
52+
id: npm-7
53+
run: |
54+
npm i --prefer-online --no-fund --no-audit -g npm@7
55+
echo "updated=true" >> "$GITHUB_OUTPUT"
56+
57+
- name: Install npm@8 on Node 12
58+
shell: bash
59+
if: startsWith(steps.node.outputs.node-version, 'v12.')
60+
id: npm-8
61+
run: |
62+
npm i --prefer-online --no-fund --no-audit -g npm@8
63+
echo "updated=true" >> "$GITHUB_OUTPUT"
64+
65+
- name: Install npm@9 on Node 14/16/18.0
66+
shell: bash
67+
if: startsWith(steps.node.outputs.node-version, 'v14.') || startsWith(steps.node.outputs.node-version, 'v16.') || startsWith(steps.node.outputs.node-version, 'v18.0.')
68+
id: npm-9
69+
run: |
70+
npm i --prefer-online --no-fund --no-audit -g npm@9
71+
echo "updated=true" >> "$GITHUB_OUTPUT"
72+
73+
- name: Install npm@latest on Node
74+
if: ${{ !(steps.npm-7.outputs.updated || steps.npm-8.outputs.updated || steps.npm-9.outputs.updated) }}
75+
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
76+
3377
- name: npm Version
3478
run: npm -v
3579
- name: Install Dependencies

0 commit comments

Comments
 (0)