Skip to content

Commit 72e9be4

Browse files
committed
feat!: postinstall for dependabot template-oss PR
BREAKING CHANGE: `pacote` is now compatible with the following semver range for node: `^14.17.0 || ^16.13.0 || >=18.0.0`
1 parent e6cd12a commit 72e9be4

14 files changed

+612
-131
lines changed

.github/dependabot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version: 2
44

55
updates:
66
- package-ecosystem: npm
7-
directory: "/"
7+
directory: /
88
schedule:
99
interval: daily
1010
allow:

.github/matchers/tap.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@
2929
]
3030
}
3131
]
32-
}
32+
}

.github/workflows/audit.yml

+18-8
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,28 @@ on:
1010

1111
jobs:
1212
audit:
13+
name: Audit Dependencies
14+
if: github.repository_owner == 'npm'
1315
runs-on: ubuntu-latest
16+
defaults:
17+
run:
18+
shell: bash
1419
steps:
15-
- uses: actions/checkout@v3
16-
- name: Setup git user
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
- name: Setup Git User
1723
run: |
1824
git config --global user.email "npm-cli+bot@github.com"
1925
git config --global user.name "npm CLI robot"
20-
- uses: actions/setup-node@v3
26+
- name: Setup Node
27+
uses: actions/setup-node@v3
2128
with:
22-
node-version: 16.x
23-
- name: Update npm to latest
29+
node-version: 18.x
30+
- name: Install npm@latest
2431
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
25-
- run: npm -v
26-
- run: npm i --ignore-scripts --no-audit --no-fund --package-lock
27-
- run: npm audit
32+
- name: npm Version
33+
run: npm -v
34+
- name: Install Dependencies
35+
run: npm i --ignore-scripts --no-audit --no-fund --package-lock
36+
- name: Run Audit
37+
run: npm audit

.github/workflows/ci-release.yml

+151
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
# This file is automatically added by @npmcli/template-oss. Do not edit.
2+
3+
name: CI - Release
4+
5+
on:
6+
workflow_call:
7+
inputs:
8+
ref:
9+
required: true
10+
type: string
11+
check-sha:
12+
required: true
13+
type: string
14+
15+
jobs:
16+
lint-all:
17+
name: Lint All
18+
if: github.repository_owner == 'npm'
19+
runs-on: ubuntu-latest
20+
defaults:
21+
run:
22+
shell: bash
23+
steps:
24+
- name: Create Check
25+
uses: LouisBrunner/checks-action@v1.3.1
26+
id: check
27+
28+
with:
29+
token: ${{ secrets.GITHUB_TOKEN }}
30+
status: in_progress
31+
name: Lint All
32+
sha: ${{ inputs.check-sha }}
33+
# XXX: this does not work when using the default GITHUB_TOKEN.
34+
# Instead we post the main job url to the PR as a comment which
35+
# will link to all the other checks. To work around this we would
36+
# need to create a GitHub that would create on-demand tokens.
37+
# https://github.com/LouisBrunner/checks-action/issues/18
38+
# details_url:
39+
- name: Checkout
40+
uses: actions/checkout@v3
41+
with:
42+
ref: ${{ inputs.ref }}
43+
- name: Setup Git User
44+
run: |
45+
git config --global user.email "npm-cli+bot@github.com"
46+
git config --global user.name "npm CLI robot"
47+
- name: Setup Node
48+
uses: actions/setup-node@v3
49+
with:
50+
node-version: 18.x
51+
- name: Install npm@latest
52+
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
53+
- name: npm Version
54+
run: npm -v
55+
- name: Install Dependencies
56+
run: npm i --ignore-scripts --no-audit --no-fund
57+
- name: Lint
58+
run: npm run lint --ignore-scripts
59+
- name: Post Lint
60+
run: npm run postlint --ignore-scripts
61+
- name: Conclude Check
62+
uses: LouisBrunner/checks-action@v1.3.1
63+
if: always()
64+
with:
65+
token: ${{ secrets.GITHUB_TOKEN }}
66+
conclusion: ${{ job.status }}
67+
check_id: ${{ steps.check.outputs.check_id }}
68+
69+
test-all:
70+
name: Test All - ${{ matrix.platform.name }} - ${{ matrix.node-version }}
71+
if: github.repository_owner == 'npm'
72+
strategy:
73+
fail-fast: false
74+
matrix:
75+
platform:
76+
- name: Linux
77+
os: ubuntu-latest
78+
shell: bash
79+
- name: macOS
80+
os: macos-latest
81+
shell: bash
82+
node-version:
83+
- 14.17.0
84+
- 14.x
85+
- 16.13.0
86+
- 16.x
87+
- 18.0.0
88+
- 18.x
89+
runs-on: ${{ matrix.platform.os }}
90+
defaults:
91+
run:
92+
shell: ${{ matrix.platform.shell }}
93+
steps:
94+
- name: Create Check
95+
uses: LouisBrunner/checks-action@v1.3.1
96+
id: check
97+
98+
with:
99+
token: ${{ secrets.GITHUB_TOKEN }}
100+
status: in_progress
101+
name: Test All - ${{ matrix.platform.name }} - ${{ matrix.node-version }}
102+
sha: ${{ inputs.check-sha }}
103+
# XXX: this does not work when using the default GITHUB_TOKEN.
104+
# Instead we post the main job url to the PR as a comment which
105+
# will link to all the other checks. To work around this we would
106+
# need to create a GitHub that would create on-demand tokens.
107+
# https://github.com/LouisBrunner/checks-action/issues/18
108+
# details_url:
109+
- name: Checkout
110+
uses: actions/checkout@v3
111+
with:
112+
ref: ${{ inputs.ref }}
113+
- name: Setup Git User
114+
run: |
115+
git config --global user.email "npm-cli+bot@github.com"
116+
git config --global user.name "npm CLI robot"
117+
- name: Setup Node
118+
uses: actions/setup-node@v3
119+
with:
120+
node-version: ${{ matrix.node-version }}
121+
- name: Update Windows npm
122+
# node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
123+
if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12.') || startsWith(matrix.node-version, '14.'))
124+
run: |
125+
curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
126+
tar xf npm-7.5.4.tgz
127+
cd package
128+
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
129+
cd ..
130+
rmdir /s /q package
131+
- name: Install npm@7
132+
if: startsWith(matrix.node-version, '10.')
133+
run: npm i --prefer-online --no-fund --no-audit -g npm@7
134+
- name: Install npm@latest
135+
if: ${{ !startsWith(matrix.node-version, '10.') }}
136+
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
137+
- name: npm Version
138+
run: npm -v
139+
- name: Install Dependencies
140+
run: npm i --ignore-scripts --no-audit --no-fund
141+
- name: Add Problem Matcher
142+
run: echo "::add-matcher::.github/matchers/tap.json"
143+
- name: Test
144+
run: npm test --ignore-scripts -ws -iwr --if-present
145+
- name: Conclude Check
146+
uses: LouisBrunner/checks-action@v1.3.1
147+
if: always()
148+
with:
149+
token: ${{ secrets.GITHUB_TOKEN }}
150+
conclusion: ${{ job.status }}
151+
check_id: ${{ steps.check.outputs.check_id }}

.github/workflows/ci.yml

+48-30
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ name: CI
55
on:
66
workflow_dispatch:
77
pull_request:
8-
branches:
9-
- '*'
108
push:
119
branches:
1210
- main
@@ -17,52 +15,70 @@ on:
1715

1816
jobs:
1917
lint:
18+
name: Lint
19+
if: github.repository_owner == 'npm'
2020
runs-on: ubuntu-latest
21+
defaults:
22+
run:
23+
shell: bash
2124
steps:
22-
- uses: actions/checkout@v3
23-
- name: Setup git user
25+
- name: Checkout
26+
uses: actions/checkout@v3
27+
- name: Setup Git User
2428
run: |
2529
git config --global user.email "npm-cli+bot@github.com"
2630
git config --global user.name "npm CLI robot"
27-
- uses: actions/setup-node@v3
31+
- name: Setup Node
32+
uses: actions/setup-node@v3
2833
with:
29-
node-version: 16.x
30-
- name: Update npm to latest
34+
node-version: 18.x
35+
- name: Install npm@latest
3136
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
32-
- run: npm -v
33-
- run: npm i --ignore-scripts --no-audit --no-fund
34-
- run: npm run lint
37+
- name: npm Version
38+
run: npm -v
39+
- name: Install Dependencies
40+
run: npm i --ignore-scripts --no-audit --no-fund
41+
- name: Lint
42+
run: npm run lint --ignore-scripts
43+
- name: Post Lint
44+
run: npm run postlint --ignore-scripts
3545

3646
test:
47+
name: Test - ${{ matrix.platform.name }} - ${{ matrix.node-version }}
48+
if: github.repository_owner == 'npm'
3749
strategy:
3850
fail-fast: false
3951
matrix:
40-
node-version:
41-
- 12.13.0
42-
- 12.x
43-
- 14.15.0
44-
- 14.x
45-
- 16.0.0
46-
- 16.x
4752
platform:
48-
- os: ubuntu-latest
53+
- name: Linux
54+
os: ubuntu-latest
4955
shell: bash
50-
- os: macos-latest
56+
- name: macOS
57+
os: macos-latest
5158
shell: bash
59+
node-version:
60+
- 14.17.0
61+
- 14.x
62+
- 16.13.0
63+
- 16.x
64+
- 18.0.0
65+
- 18.x
5266
runs-on: ${{ matrix.platform.os }}
5367
defaults:
5468
run:
5569
shell: ${{ matrix.platform.shell }}
5670
steps:
57-
- uses: actions/checkout@v3
58-
- name: Setup git user
71+
- name: Checkout
72+
uses: actions/checkout@v3
73+
- name: Setup Git User
5974
run: |
6075
git config --global user.email "npm-cli+bot@github.com"
6176
git config --global user.name "npm CLI robot"
62-
- uses: actions/setup-node@v3
77+
- name: Setup Node
78+
uses: actions/setup-node@v3
6379
with:
6480
node-version: ${{ matrix.node-version }}
65-
- name: Update to workable npm (windows)
81+
- name: Update Windows npm
6682
# node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows
6783
if: matrix.platform.os == 'windows-latest' && (startsWith(matrix.node-version, '12.') || startsWith(matrix.node-version, '14.'))
6884
run: |
@@ -72,15 +88,17 @@ jobs:
7288
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
7389
cd ..
7490
rmdir /s /q package
75-
- name: Update npm to 7
76-
# If we do test on npm 10 it needs npm7
91+
- name: Install npm@7
7792
if: startsWith(matrix.node-version, '10.')
7893
run: npm i --prefer-online --no-fund --no-audit -g npm@7
79-
- name: Update npm to latest
94+
- name: Install npm@latest
8095
if: ${{ !startsWith(matrix.node-version, '10.') }}
8196
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
82-
- run: npm -v
83-
- name: add tap problem matcher
97+
- name: npm Version
98+
run: npm -v
99+
- name: Install Dependencies
100+
run: npm i --ignore-scripts --no-audit --no-fund
101+
- name: Add Problem Matcher
84102
run: echo "::add-matcher::.github/matchers/tap.json"
85-
- run: npm i --ignore-scripts --no-audit --no-fund
86-
- run: npm test --ignore-scripts
103+
- name: Test
104+
run: npm test --ignore-scripts -iwr

.github/workflows/codeql-analysis.yml

+7-13
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
# This file is automatically added by @npmcli/template-oss. Do not edit.
22

3-
name: "CodeQL"
3+
name: CodeQL
44

55
on:
66
push:
77
branches:
88
- main
99
- latest
1010
pull_request:
11-
# The branches below must be a subset of the branches above
1211
branches:
1312
- main
1413
- latest
@@ -24,21 +23,16 @@ jobs:
2423
actions: read
2524
contents: read
2625
security-events: write
27-
28-
strategy:
29-
fail-fast: false
30-
matrix:
31-
language: [ javascript ]
32-
3326
steps:
34-
- uses: actions/checkout@v3
35-
- name: Setup git user
27+
- name: Checkout
28+
uses: actions/checkout@v3
29+
- name: Setup Git User
3630
run: |
3731
git config --global user.email "npm-cli+bot@github.com"
3832
git config --global user.name "npm CLI robot"
3933
- name: Initialize CodeQL
40-
uses: github/codeql-action/init@v1
34+
uses: github/codeql-action/init@v2
4135
with:
42-
languages: ${{ matrix.language }}
36+
languages: javascript
4337
- name: Perform CodeQL Analysis
44-
uses: github/codeql-action/analyze@v1
38+
uses: github/codeql-action/analyze@v2

0 commit comments

Comments
 (0)