Skip to content

Commit eefd119

Browse files
nlfwraithgar
authored andcommitted
chore: bump @npmcli/template-oss from 4.11.0 to 4.11.1
1 parent 53bbc14 commit eefd119

File tree

19 files changed

+143
-79
lines changed

19 files changed

+143
-79
lines changed

.github/workflows/release.yml

Lines changed: 89 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ jobs:
1919
release:
2020
outputs:
2121
pr: ${{ steps.release.outputs.pr }}
22+
release: ${{ steps.release.outputs.release }}
2223
releases: ${{ steps.release.outputs.releases }}
23-
release-flags: ${{ steps.release.outputs.release-flags }}
2424
branch: ${{ steps.release.outputs.pr-branch }}
2525
pr-number: ${{ steps.release.outputs.pr-number }}
2626
comment-id: ${{ steps.pr-comment.outputs.result }}
@@ -60,26 +60,25 @@ jobs:
6060
REF_NAME: ${{ github.ref_name }}
6161
with:
6262
script: |
63-
const { REF_NAME, PR_NUMBER } = process.env
64-
const repo = { owner: context.repo.owner, repo: context.repo.repo }
65-
const issue = { ...repo, issue_number: PR_NUMBER }
63+
const { REF_NAME, PR_NUMBER: issue_number } = process.env
64+
const { runId, repo: { owner, repo } } = context
6665
67-
const { data: workflow } = await github.rest.actions.getWorkflowRun({ ...repo, run_id: context.runId })
66+
const { data: workflow } = await github.rest.actions.getWorkflowRun({ owner, repo, run_id: runId })
6867
6968
let body = '## Release Manager\n\n'
7069
71-
const comments = await github.paginate(github.rest.issues.listComments, issue)
72-
let commentId = comments?.find(c => c.user.login === 'github-actions[bot]' && c.body.startsWith(body))?.id
70+
const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number })
71+
let commentId = comments.find(c => c.user.login === 'github-actions[bot]' && c.body.startsWith(body))?.id
7372
7473
body += `Release workflow run: ${workflow.html_url}\n\n#### Force CI to Update This Release\n\n`
7574
body += `This PR will be updated and CI will run for every non-\`chore:\` commit that is pushed to \`latest\`. `
7675
body += `To force CI to update this PR, run this command:\n\n`
77-
body += `\`\`\`\ngh workflow run release.yml -r ${REF_NAME}\n\`\`\``
76+
body += `\`\`\`\ngh workflow run release.yml -r ${REF_NAME} -R ${owner}/${repo}\n\`\`\``
7877
7978
if (commentId) {
80-
await github.rest.issues.updateComment({ ...repo, comment_id: commentId, body })
79+
await github.rest.issues.updateComment({ owner, repo, comment_id: commentId, body })
8180
} else {
82-
const { data: comment } = await github.rest.issues.createComment({ ...issue, body })
81+
const { data: comment } = await github.rest.issues.createComment({ owner, repo, issue_number, body })
8382
commentId = comment?.id
8483
}
8584
@@ -270,21 +269,86 @@ jobs:
270269
run:
271270
shell: bash
272271
steps:
273-
- name: Checkout
274-
uses: actions/checkout@v3
275-
- name: Setup Git User
276-
run: |
277-
git config --global user.email "[email protected]"
278-
git config --global user.name "npm CLI robot"
279-
- name: Setup Node
280-
uses: actions/setup-node@v3
281-
with:
282-
node-version: 18.x
283-
cache: npm
284-
- name: Reset Deps
285-
run: node . run resetdeps
286-
- name: Run Post Release Actions
272+
- name: Create Release PR Comment
273+
uses: actions/github-script@v6
287274
env:
288275
RELEASES: ${{ needs.release.outputs.releases }}
276+
with:
277+
script: |
278+
const releases = JSON.parse(process.env.RELEASES)
279+
const { runId, repo: { owner, repo } } = context
280+
const issue_number = releases[0].prNumber
281+
282+
let body = '## Release Workflow\n\n'
283+
for (const { pkgName, version, url } of releases) {
284+
body += `- \`${pkgName}@${version}\` ${url}\n`
285+
}
286+
287+
const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number })
288+
const releaseComments = comments.filter(c => c.user.login === 'github-actions[bot]' && c.body.includes('Release is at'))
289+
290+
for (const comment of releaseComments) {
291+
await github.rest.issues.deleteComment({ owner, repo, comment_id: comment.id })
292+
}
293+
294+
const runUrl = `https://github.com/${owner}/${repo}/actions/runs/${runId}`
295+
await github.rest.issues.createComment({
296+
owner,
297+
repo,
298+
issue_number,
299+
body: `${body}- Workflow run: :arrows_counterclockwise: ${runUrl}`,
300+
})
301+
302+
release-integration:
303+
needs: release
304+
name: Release Integration
305+
if: needs.release.outputs.release
306+
uses: ./.github/workflows/release-integration.yml
307+
with:
308+
npmVersion: ${{ fromJSON(needs.release.outputs.release).version }}
309+
310+
post-release-integration:
311+
needs: [ release, release-integration ]
312+
name: Post Release Integration - Release
313+
if: github.repository_owner == 'npm' && needs.release.outputs.release && always()
314+
runs-on: ubuntu-latest
315+
defaults:
316+
run:
317+
shell: bash
318+
steps:
319+
- name: Get Needs Result
320+
id: needs-result
289321
run: |
290-
node . run rp-release --ignore-scripts --if-present ${{ join(fromJSON(needs.release.outputs.release-flags), ' ') }}
322+
result=""
323+
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
324+
result="x"
325+
elif [[ "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
326+
result="heavy_multiplication_x"
327+
else
328+
result="white_check_mark"
329+
fi
330+
echo "::set-output name=result::$result"
331+
- name: Update Release PR Comment
332+
uses: actions/github-script@v6
333+
env:
334+
PR_NUMBER: ${{ fromJSON(needs.release.outputs.release).prNumber }}
335+
RESULT: ${{ steps.needs-result.outputs.result }}
336+
with:
337+
script: |
338+
const { PR_NUMBER: issue_number, RESULT } = process.env
339+
const { repo: { owner, repo } } = context
340+
341+
const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number })
342+
const updateComment = comments.find(c => c.user.login === 'github-actions[bot]' && c.body.startsWith('## Release Workflow\n\n'))
343+
344+
if (updateComment) {
345+
console.log('Found comment to update:', JSON.stringify(updateComment, null, 2))
346+
await github.rest.issues.updateComment({
347+
owner,
348+
repo,
349+
comment_id: updateComment.id,
350+
body: updateComment.body.replace(/Workflow run: :[a-z_]+:/, `Workflow run: :${RESULT}:`),
351+
})
352+
} else {
353+
console.log('No matching comments found:', JSON.stringify(comments, null, 2))
354+
}

docs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"devDependencies": {
2323
"@isaacs/string-locale-compare": "^1.1.0",
2424
"@npmcli/eslint-config": "^4.0.0",
25-
"@npmcli/template-oss": "4.11.0",
25+
"@npmcli/template-oss": "4.11.1",
2626
"front-matter": "^4.0.2",
2727
"ignore-walk": "^6.0.0",
2828
"jsdom": "^20.0.3",
@@ -56,7 +56,7 @@
5656
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
5757
"ciVersions": "latest",
5858
"engines": "^14.17.0 || ^16.13.0 || >=18.0.0",
59-
"version": "4.11.0",
59+
"version": "4.11.1",
6060
"content": "../scripts/template-oss/index.js",
6161
"workspaceRepo": {
6262
"add": {

mock-registry/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
},
3535
"templateOSS": {
3636
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
37-
"version": "4.11.0"
37+
"version": "4.11.1"
3838
},
3939
"tap": {
4040
"no-coverage": true,
@@ -46,7 +46,7 @@
4646
"devDependencies": {
4747
"@npmcli/arborist": "^6.1.1",
4848
"@npmcli/eslint-config": "^4.0.1",
49-
"@npmcli/template-oss": "4.11.0",
49+
"@npmcli/template-oss": "4.11.1",
5050
"nock": "^13.2.9",
5151
"npm-package-arg": "^10.1.0",
5252
"pacote": "^15.0.7",

package-lock.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
"@npmcli/git": "^4.0.1",
164164
"@npmcli/mock-registry": "^1.0.0",
165165
"@npmcli/promise-spawn": "^6.0.1",
166-
"@npmcli/template-oss": "4.11.0",
166+
"@npmcli/template-oss": "4.11.1",
167167
"licensee": "^10.0.0",
168168
"nock": "^13.2.4",
169169
"npm-packlist": "^7.0.4",
@@ -184,7 +184,7 @@
184184
"devDependencies": {
185185
"@isaacs/string-locale-compare": "^1.1.0",
186186
"@npmcli/eslint-config": "^4.0.0",
187-
"@npmcli/template-oss": "4.11.0",
187+
"@npmcli/template-oss": "4.11.1",
188188
"front-matter": "^4.0.2",
189189
"ignore-walk": "^6.0.0",
190190
"jsdom": "^20.0.3",
@@ -209,7 +209,7 @@
209209
"devDependencies": {
210210
"@npmcli/arborist": "^6.1.1",
211211
"@npmcli/eslint-config": "^4.0.1",
212-
"@npmcli/template-oss": "4.11.0",
212+
"@npmcli/template-oss": "4.11.1",
213213
"nock": "^13.2.9",
214214
"npm-package-arg": "^10.1.0",
215215
"pacote": "^15.0.7",
@@ -2258,9 +2258,9 @@
22582258
"link": true
22592259
},
22602260
"node_modules/@npmcli/template-oss": {
2261-
"version": "4.11.0",
2262-
"resolved": "https://registry.npmjs.org/@npmcli/template-oss/-/template-oss-4.11.0.tgz",
2263-
"integrity": "sha512-nvZqRxT9AFf56Fj07v1yG9AQVOTNn82ysMVI67IzpktunKFHmZ5Tp8P/al5pPik/nYQ4AieEyh7XC2dMro4moA==",
2261+
"version": "4.11.1",
2262+
"resolved": "https://registry.npmjs.org/@npmcli/template-oss/-/template-oss-4.11.1.tgz",
2263+
"integrity": "sha512-Rs0sYcHhbcLA9mfQz/ojdNjKIMqyPG9kA/Ie2W4OxuBeVR/rhDf7yL4iqTK4Rum9dRVz9jWXex5PDNyDyiQnHw==",
22642264
"dev": true,
22652265
"hasInstallScript": true,
22662266
"dependencies": {
@@ -14290,7 +14290,7 @@
1429014290
"@npmcli/eslint-config": "^4.0.0",
1429114291
"@npmcli/mock-registry": "^1.0.0",
1429214292
"@npmcli/promise-spawn": "^6.0.1",
14293-
"@npmcli/template-oss": "4.11.0",
14293+
"@npmcli/template-oss": "4.11.1",
1429414294
"http-proxy": "^1.18.1",
1429514295
"just-extend": "^6.1.1",
1429614296
"just-safe-set": "^4.1.1",
@@ -14345,7 +14345,7 @@
1434514345
},
1434614346
"devDependencies": {
1434714347
"@npmcli/eslint-config": "^4.0.0",
14348-
"@npmcli/template-oss": "4.11.0",
14348+
"@npmcli/template-oss": "4.11.1",
1434914349
"benchmark": "^2.1.4",
1435014350
"chalk": "^4.1.0",
1435114351
"minify-registry-metadata": "^3.0.0",
@@ -14372,7 +14372,7 @@
1437214372
},
1437314373
"devDependencies": {
1437414374
"@npmcli/eslint-config": "^4.0.0",
14375-
"@npmcli/template-oss": "4.11.0",
14375+
"@npmcli/template-oss": "4.11.1",
1437614376
"tap": "^16.3.2"
1437714377
},
1437814378
"engines": {
@@ -14389,7 +14389,7 @@
1438914389
"devDependencies": {
1439014390
"@npmcli/eslint-config": "^4.0.0",
1439114391
"@npmcli/mock-registry": "^1.0.0",
14392-
"@npmcli/template-oss": "4.11.0",
14392+
"@npmcli/template-oss": "4.11.1",
1439314393
"nock": "^13.2.4",
1439414394
"tap": "^16.3.2"
1439514395
},
@@ -14413,7 +14413,7 @@
1441314413
},
1441414414
"devDependencies": {
1441514415
"@npmcli/eslint-config": "^4.0.0",
14416-
"@npmcli/template-oss": "4.11.0",
14416+
"@npmcli/template-oss": "4.11.1",
1441714417
"tap": "^16.3.2"
1441814418
},
1441914419
"engines": {
@@ -14440,7 +14440,7 @@
1444014440
"devDependencies": {
1444114441
"@npmcli/eslint-config": "^4.0.0",
1444214442
"@npmcli/mock-registry": "^1.0.0",
14443-
"@npmcli/template-oss": "4.11.0",
14443+
"@npmcli/template-oss": "4.11.1",
1444414444
"bin-links": "^4.0.1",
1444514445
"just-extend": "^6.1.1",
1444614446
"just-safe-set": "^4.1.1",
@@ -14460,7 +14460,7 @@
1446014460
},
1446114461
"devDependencies": {
1446214462
"@npmcli/eslint-config": "^4.0.0",
14463-
"@npmcli/template-oss": "4.11.0",
14463+
"@npmcli/template-oss": "4.11.1",
1446414464
"tap": "^16.3.2"
1446514465
},
1446614466
"engines": {
@@ -14476,7 +14476,7 @@
1447614476
},
1447714477
"devDependencies": {
1447814478
"@npmcli/eslint-config": "^4.0.0",
14479-
"@npmcli/template-oss": "4.11.0",
14479+
"@npmcli/template-oss": "4.11.1",
1448014480
"nock": "^13.2.4",
1448114481
"tap": "^16.3.2"
1448214482
},
@@ -14493,7 +14493,7 @@
1449314493
},
1449414494
"devDependencies": {
1449514495
"@npmcli/eslint-config": "^4.0.0",
14496-
"@npmcli/template-oss": "4.11.0",
14496+
"@npmcli/template-oss": "4.11.1",
1449714497
"minipass": "^4.0.0",
1449814498
"nock": "^13.2.4",
1449914499
"tap": "^16.3.2"
@@ -14513,7 +14513,7 @@
1451314513
},
1451414514
"devDependencies": {
1451514515
"@npmcli/eslint-config": "^4.0.0",
14516-
"@npmcli/template-oss": "4.11.0",
14516+
"@npmcli/template-oss": "4.11.1",
1451714517
"nock": "^13.0.7",
1451814518
"spawk": "^1.7.1",
1451914519
"tap": "^16.3.2"
@@ -14535,7 +14535,7 @@
1453514535
"devDependencies": {
1453614536
"@npmcli/eslint-config": "^4.0.0",
1453714537
"@npmcli/mock-registry": "^1.0.0",
14538-
"@npmcli/template-oss": "4.11.0",
14538+
"@npmcli/template-oss": "4.11.1",
1453914539
"lodash.clonedeep": "^4.5.0",
1454014540
"nock": "^13.2.4",
1454114541
"tap": "^16.3.2"
@@ -14552,7 +14552,7 @@
1455214552
},
1455314553
"devDependencies": {
1455414554
"@npmcli/eslint-config": "^4.0.0",
14555-
"@npmcli/template-oss": "4.11.0",
14555+
"@npmcli/template-oss": "4.11.1",
1455614556
"nock": "^13.2.4",
1455714557
"tap": "^16.3.2"
1455814558
},
@@ -14569,7 +14569,7 @@
1456914569
},
1457014570
"devDependencies": {
1457114571
"@npmcli/eslint-config": "^4.0.0",
14572-
"@npmcli/template-oss": "4.11.0",
14572+
"@npmcli/template-oss": "4.11.1",
1457314573
"nock": "^13.2.4",
1457414574
"tap": "^16.3.2"
1457514575
},
@@ -14589,7 +14589,7 @@
1458914589
},
1459014590
"devDependencies": {
1459114591
"@npmcli/eslint-config": "^4.0.0",
14592-
"@npmcli/template-oss": "4.11.0",
14592+
"@npmcli/template-oss": "4.11.1",
1459314593
"require-inject": "^1.4.4",
1459414594
"tap": "^16.3.2"
1459514595
},

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
"@npmcli/git": "^4.0.1",
197197
"@npmcli/mock-registry": "^1.0.0",
198198
"@npmcli/promise-spawn": "^6.0.1",
199-
"@npmcli/template-oss": "4.11.0",
199+
"@npmcli/template-oss": "4.11.1",
200200
"licensee": "^10.0.0",
201201
"nock": "^13.2.4",
202202
"npm-packlist": "^7.0.4",
@@ -250,7 +250,7 @@
250250
},
251251
"templateOSS": {
252252
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
253-
"version": "4.11.0",
253+
"version": "4.11.1",
254254
"content": "./scripts/template-oss/root.js"
255255
},
256256
"license": "Artistic-2.0",

smoke-tests/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"@npmcli/eslint-config": "^4.0.0",
2222
"@npmcli/mock-registry": "^1.0.0",
2323
"@npmcli/promise-spawn": "^6.0.1",
24-
"@npmcli/template-oss": "4.11.0",
24+
"@npmcli/template-oss": "4.11.1",
2525
"http-proxy": "^1.18.1",
2626
"just-extend": "^6.1.1",
2727
"just-safe-set": "^4.1.1",
@@ -32,7 +32,7 @@
3232
"license": "ISC",
3333
"templateOSS": {
3434
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
35-
"version": "4.11.0",
35+
"version": "4.11.1",
3636
"content": "../scripts/template-oss/index.js"
3737
},
3838
"tap": {

0 commit comments

Comments
 (0)