@npmcli/template-oss 4.11.1 → 4.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- * @npm/cli-team
1
+ * {{ codeowner }}
@@ -3,10 +3,30 @@ defaults:
3
3
  run:
4
4
  shell: bash
5
5
  steps:
6
- {{> stepGit }}
7
- {{> stepNode }}
6
+ {{> stepNode lockfile=false }}
8
7
  - name: View in Registry
9
8
  run: |
10
- name=$(cat package.json | jq -r .name)
11
- version="$\{{ fromJSON(needs.release.output.release).version }}"
12
- npm view ${name}@${version}
9
+ EXIT_CODE=0
10
+
11
+ function is_published {
12
+ if npm view "$@" --loglevel=error > /dev/null; then
13
+ echo 0
14
+ else
15
+ echo 1
16
+ fi
17
+ }
18
+
19
+ for release in $(echo '$\{{ needs.release.outputs.releases }}' | jq -r '.[] | @base64'); do
20
+ name=$(echo "$release" | base64 --decode | jq -r .pkgName)
21
+ version=$(echo "$release" | base64 --decode | jq -r .version)
22
+ spec="$name@$version"
23
+ status=$(is_published "$spec")
24
+ if [[ "$status" -eq 1 ]]; then
25
+ echo "$spec ERROR"
26
+ EXIT_CODE=$status
27
+ else
28
+ echo "$spec OK"
29
+ fi
30
+ done
31
+
32
+ exit $EXIT_CODE
@@ -150,6 +150,7 @@ module.exports = {
150
150
  ignorePaths: [],
151
151
  ciVersions: ['14.17.0', '14.x', '16.13.0', '16.x', '18.0.0', '18.x'],
152
152
  lockfile: false,
153
+ codeowner: '@npm/cli-team',
153
154
  npm: 'npm',
154
155
  npx: 'npx',
155
156
  npmSpec: 'latest',
@@ -189,11 +189,18 @@ jobs:
189
189
 
190
190
  if (updateComment) {
191
191
  console.log('Found comment to update:', JSON.stringify(updateComment, null, 2))
192
+ let body = updateComment.body.replace(/Workflow run: :[a-z_]+:/, `Workflow run: :${RESULT}:`)
193
+ if (RESULT === 'x') {
194
+ body += `\n\n:rotating_light:`
195
+ body += ` {{ codeowner }}: The post-release workflow failed for this release.`
196
+ body += ` Manual steps may need to be taken after examining the workflow output`
197
+ body += ` from the above workflow run. :rotating_light:`
198
+ }
192
199
  await github.rest.issues.updateComment({
193
200
  owner,
194
201
  repo,
202
+ body,
195
203
  comment_id: updateComment.id,
196
- body: updateComment.body.replace(/Workflow run: :[a-z_]+:/, `Workflow run: :${RESULT}:`),
197
204
  })
198
205
  } else {
199
206
  console.log('No matching comments found:', JSON.stringify(comments, null, 2))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npmcli/template-oss",
3
- "version": "4.11.1",
3
+ "version": "4.11.2",
4
4
  "description": "templated files used in npm CLI team oss projects",
5
5
  "main": "lib/content/index.js",
6
6
  "bin": {