Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys authored Feb 7, 2023
1 parent cb6713d commit 66dd0d6
Show file tree
Hide file tree
Showing 19 changed files with 71 additions and 60 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ name: Release

on:
workflow_dispatch:
inputs:
release-pr:
description: a release PR number to rerun release jobs on
type: string
push:
branches:
- main
Expand Down Expand Up @@ -50,7 +54,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npx --offline template-oss-release-please ${{ github.ref_name }} ${{ github.event_name }}
npx --offline template-oss-release-please "${{ github.ref_name }}" "${{ inputs.release-pr }}"
- name: Post Pull Request Comment
if: steps.release.outputs.pr-number
uses: actions/github-script@v6
Expand All @@ -73,7 +77,7 @@ jobs:
body += `Release workflow run: ${workflow.html_url}\n\n#### Force CI to Update This Release\n\n`
body += `This PR will be updated and CI will run for every non-\`chore:\` commit that is pushed to \`latest\`. `
body += `To force CI to update this PR, run this command:\n\n`
body += `\`\`\`\ngh workflow run release.yml -r ${REF_NAME} -R ${owner}/${repo}\n\`\`\``
body += `\`\`\`\ngh workflow run release.yml -r ${REF_NAME} -R ${owner}/${repo} -f release-pr=${issue_number}\n\`\`\``
if (commentId) {
await github.rest.issues.updateComment({ owner, repo, comment_id: commentId, body })
Expand Down Expand Up @@ -285,14 +289,17 @@ jobs:
}
const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number })
const releaseComments = comments.filter(c => c.user.login === 'github-actions[bot]' && c.body.includes('Release is at'))
.then(cs => cs.map(c => ({ id: c.id, login: c.user.login, body: c.body })))
console.log(`Found comments: ${JSON.stringify(comments, null, 2)}`)
const releaseComments = comments.filter(c => c.login === 'github-actions[bot]' && c.body.includes('Release is at'))
for (const comment of releaseComments) {
console.log(`Release comment: ${JSON.stringify(comment, null, 2)}`)
await github.rest.issues.deleteComment({ owner, repo, comment_id: comment.id })
}
const runUrl = `https://github.com/${owner}/${repo}/actions/runs/${runId}`
await github.rest.issues.createComment({
await github.rest.issues.createComment({
owner,
repo,
issue_number,
Expand Down Expand Up @@ -344,10 +351,14 @@ jobs:
with:
script: |
const { PR_NUMBER: issue_number, RESULT } = process.env
const { repo: { owner, repo } } = context
const { runId, repo: { owner, repo } } = context
const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number })
const updateComment = comments.find(c => c.user.login === 'github-actions[bot]' && c.body.startsWith('## Release Workflow\n\n'))
const updateComment = comments.find(c =>
c.user.login === 'github-actions[bot]' &&
c.body.startsWith('## Release Workflow\n\n') &&
c.body.includes(runId)
)
if (updateComment) {
console.log('Found comment to update:', JSON.stringify(updateComment, null, 2))
Expand Down
4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"devDependencies": {
"@isaacs/string-locale-compare": "^1.1.0",
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.11.3",
"@npmcli/template-oss": "4.11.4",
"front-matter": "^4.0.2",
"ignore-walk": "^6.0.1",
"jsdom": "^21.1.0",
Expand Down Expand Up @@ -55,7 +55,7 @@
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"ciVersions": "latest",
"engines": "^14.17.0 || ^16.13.0 || >=18.0.0",
"version": "4.11.3",
"version": "4.11.4",
"content": "../scripts/template-oss/index.js",
"workspaceRepo": {
"add": {
Expand Down
4 changes: 2 additions & 2 deletions mock-registry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.11.3"
"version": "4.11.4"
},
"tap": {
"no-coverage": true,
Expand All @@ -46,7 +46,7 @@
"devDependencies": {
"@npmcli/arborist": "^6.1.1",
"@npmcli/eslint-config": "^4.0.1",
"@npmcli/template-oss": "4.11.3",
"@npmcli/template-oss": "4.11.4",
"nock": "^13.3.0",
"npm-package-arg": "^10.1.0",
"pacote": "^15.0.8",
Expand Down
40 changes: 20 additions & 20 deletions package-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
"@npmcli/git": "^4.0.1",
"@npmcli/mock-registry": "^1.0.0",
"@npmcli/promise-spawn": "^6.0.2",
"@npmcli/template-oss": "4.11.3",
"@npmcli/template-oss": "4.11.4",
"licensee": "^10.0.0",
"nock": "^13.3.0",
"npm-packlist": "^7.0.4",
Expand All @@ -182,7 +182,7 @@
"devDependencies": {
"@isaacs/string-locale-compare": "^1.1.0",
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.11.3",
"@npmcli/template-oss": "4.11.4",
"front-matter": "^4.0.2",
"ignore-walk": "^6.0.1",
"jsdom": "^21.1.0",
Expand All @@ -206,7 +206,7 @@
"devDependencies": {
"@npmcli/arborist": "^6.1.1",
"@npmcli/eslint-config": "^4.0.1",
"@npmcli/template-oss": "4.11.3",
"@npmcli/template-oss": "4.11.4",
"nock": "^13.3.0",
"npm-package-arg": "^10.1.0",
"pacote": "^15.0.8",
Expand Down Expand Up @@ -2218,9 +2218,9 @@
"link": true
},
"node_modules/@npmcli/template-oss": {
"version": "4.11.3",
"resolved": "https://registry.npmjs.org/@npmcli/template-oss/-/template-oss-4.11.3.tgz",
"integrity": "sha512-AEpwlpIXsiPUnM9gFHQHtXkyq1atSHL+bINSANPrR9SAwXSGchprbXRxZunlciWvEkX+GS99tbE6k65dbj8MgQ==",
"version": "4.11.4",
"resolved": "https://registry.npmjs.org/@npmcli/template-oss/-/template-oss-4.11.4.tgz",
"integrity": "sha512-PtUacQfLt5yl+OuUb9XW9Bw3ZGMwDnV5dCbtUVFr4J+Ig5RVMyDjB0VmI3Uu4v9ntBNBINzvNBP1Hb3UCzoA4Q==",
"dev": true,
"hasInstallScript": true,
"dependencies": {
Expand Down Expand Up @@ -14909,7 +14909,7 @@
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/mock-registry": "^1.0.0",
"@npmcli/promise-spawn": "^6.0.2",
"@npmcli/template-oss": "4.11.3",
"@npmcli/template-oss": "4.11.4",
"http-proxy": "^1.18.1",
"just-extend": "^6.2.0",
"just-safe-set": "^4.2.1",
Expand Down Expand Up @@ -14964,7 +14964,7 @@
},
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.11.3",
"@npmcli/template-oss": "4.11.4",
"benchmark": "^2.1.4",
"chalk": "^4.1.0",
"minify-registry-metadata": "^3.0.0",
Expand Down Expand Up @@ -14992,7 +14992,7 @@
},
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.11.3",
"@npmcli/template-oss": "4.11.4",
"tap": "^16.3.4"
},
"engines": {
Expand All @@ -15009,7 +15009,7 @@
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/mock-registry": "^1.0.0",
"@npmcli/template-oss": "4.11.3",
"@npmcli/template-oss": "4.11.4",
"nock": "^13.3.0",
"tap": "^16.3.4"
},
Expand All @@ -15033,7 +15033,7 @@
},
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.11.3",
"@npmcli/template-oss": "4.11.4",
"tap": "^16.3.4"
},
"engines": {
Expand All @@ -15060,7 +15060,7 @@
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/mock-registry": "^1.0.0",
"@npmcli/template-oss": "4.11.3",
"@npmcli/template-oss": "4.11.4",
"bin-links": "^4.0.1",
"just-extend": "^6.2.0",
"just-safe-set": "^4.2.1",
Expand All @@ -15079,7 +15079,7 @@
},
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.11.3",
"@npmcli/template-oss": "4.11.4",
"tap": "^16.3.4"
},
"engines": {
Expand All @@ -15095,7 +15095,7 @@
},
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.11.3",
"@npmcli/template-oss": "4.11.4",
"nock": "^13.3.0",
"tap": "^16.3.4"
},
Expand All @@ -15112,7 +15112,7 @@
},
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.11.3",
"@npmcli/template-oss": "4.11.4",
"minipass": "^4.0.2",
"nock": "^13.3.0",
"tap": "^16.3.4"
Expand All @@ -15132,7 +15132,7 @@
},
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.11.3",
"@npmcli/template-oss": "4.11.4",
"nock": "^13.3.0",
"spawk": "^1.7.1",
"tap": "^16.3.4"
Expand All @@ -15154,7 +15154,7 @@
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/mock-registry": "^1.0.0",
"@npmcli/template-oss": "4.11.3",
"@npmcli/template-oss": "4.11.4",
"lodash.clonedeep": "^4.5.0",
"nock": "^13.3.0",
"tap": "^16.3.4"
Expand All @@ -15171,7 +15171,7 @@
},
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.11.3",
"@npmcli/template-oss": "4.11.4",
"nock": "^13.3.0",
"tap": "^16.3.4"
},
Expand All @@ -15188,7 +15188,7 @@
},
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.11.3",
"@npmcli/template-oss": "4.11.4",
"nock": "^13.3.0",
"tap": "^16.3.4"
},
Expand All @@ -15208,7 +15208,7 @@
},
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.11.3",
"@npmcli/template-oss": "4.11.4",
"require-inject": "^1.4.4",
"tap": "^16.3.4"
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
"@npmcli/git": "^4.0.1",
"@npmcli/mock-registry": "^1.0.0",
"@npmcli/promise-spawn": "^6.0.2",
"@npmcli/template-oss": "4.11.3",
"@npmcli/template-oss": "4.11.4",
"licensee": "^10.0.0",
"nock": "^13.3.0",
"npm-packlist": "^7.0.4",
Expand Down Expand Up @@ -248,7 +248,7 @@
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.11.3",
"version": "4.11.4",
"content": "./scripts/template-oss/root.js"
},
"license": "Artistic-2.0",
Expand Down
4 changes: 2 additions & 2 deletions smoke-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/mock-registry": "^1.0.0",
"@npmcli/promise-spawn": "^6.0.2",
"@npmcli/template-oss": "4.11.3",
"@npmcli/template-oss": "4.11.4",
"http-proxy": "^1.18.1",
"just-extend": "^6.2.0",
"just-safe-set": "^4.2.1",
Expand All @@ -32,7 +32,7 @@
"license": "ISC",
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.11.3",
"version": "4.11.4",
"content": "../scripts/template-oss/index.js"
},
"tap": {
Expand Down
4 changes: 2 additions & 2 deletions workspaces/arborist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.11.3",
"@npmcli/template-oss": "4.11.4",
"benchmark": "^2.1.4",
"chalk": "^4.1.0",
"minify-registry-metadata": "^3.0.0",
Expand Down Expand Up @@ -98,7 +98,7 @@
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.11.3",
"version": "4.11.4",
"content": "../../scripts/template-oss/index.js"
}
}
4 changes: 2 additions & 2 deletions workspaces/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.11.3",
"@npmcli/template-oss": "4.11.4",
"tap": "^16.3.4"
},
"dependencies": {
Expand All @@ -50,6 +50,6 @@
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.11.3"
"version": "4.11.4"
}
}
4 changes: 2 additions & 2 deletions workspaces/libnpmaccess/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/mock-registry": "^1.0.0",
"@npmcli/template-oss": "4.11.3",
"@npmcli/template-oss": "4.11.4",
"nock": "^13.3.0",
"tap": "^16.3.4"
},
Expand All @@ -41,7 +41,7 @@
],
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.11.3",
"version": "4.11.4",
"content": "../../scripts/template-oss/index.js"
},
"tap": {
Expand Down
4 changes: 2 additions & 2 deletions workspaces/libnpmdiff/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.11.3",
"@npmcli/template-oss": "4.11.4",
"tap": "^16.3.4"
},
"dependencies": {
Expand All @@ -58,7 +58,7 @@
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.11.3",
"version": "4.11.4",
"content": "../../scripts/template-oss/index.js"
},
"tap": {
Expand Down
4 changes: 2 additions & 2 deletions workspaces/libnpmexec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/mock-registry": "^1.0.0",
"@npmcli/template-oss": "4.11.3",
"@npmcli/template-oss": "4.11.4",
"bin-links": "^4.0.1",
"just-extend": "^6.2.0",
"just-safe-set": "^4.2.1",
Expand All @@ -75,7 +75,7 @@
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.11.3",
"version": "4.11.4",
"content": "../../scripts/template-oss/index.js"
}
}
Loading

0 comments on commit 66dd0d6

Please sign in to comment.