From 9440c4f2a8292d4920d9a6d815a13dbd75146ecf Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Tue, 7 May 2024 13:03:00 -0700 Subject: [PATCH] fix: pass releases to publish check (#444) If `publish: true` is not set, then the release intergration workflow falls back to running `npm view $SPEC` which will error if the package has not been published. This tags the CODEOWNERS in the release issue so we know something went wrong. This doesn't have much use now that we are moving everything to `publish: true` but it would have caught a missing publish last week that I missed on `@npmcli/fs`: https://github.com/npm/fs/actions/runs/8946801618/job/24577963034#step:7:4 The `RELEASES` env var was only being set for the publish step, not the check if published step. --- lib/content/_job-release-integration-yml.hbs | 2 ++ package.json | 2 +- tap-snapshots/test/apply/source-snapshots.js.test.cjs | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/content/_job-release-integration-yml.hbs b/lib/content/_job-release-integration-yml.hbs index daeba3c2..97efc840 100644 --- a/lib/content/_job-release-integration-yml.hbs +++ b/lib/content/_job-release-integration-yml.hbs @@ -19,6 +19,8 @@ steps: {{else}} {{> stepsSetupYml }} - name: Check If Published + env: + RELEASES: $\{{ inputs.releases }} {{/if}} run: | EXIT_CODE=0 diff --git a/package.json b/package.json index 010c7930..ee52ed43 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ ], "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.22.0", + "@npmcli/template-oss": "file:./", "nock": "^13.3.8", "tap": "^16.0.0" }, diff --git a/tap-snapshots/test/apply/source-snapshots.js.test.cjs b/tap-snapshots/test/apply/source-snapshots.js.test.cjs index 5ef24507..b0462e69 100644 --- a/tap-snapshots/test/apply/source-snapshots.js.test.cjs +++ b/tap-snapshots/test/apply/source-snapshots.js.test.cjs @@ -898,6 +898,8 @@ jobs: - name: Install Dependencies run: npm i --ignore-scripts --no-audit --no-fund - name: Check If Published + env: + RELEASES: \${{ inputs.releases }} run: | EXIT_CODE=0 @@ -2552,6 +2554,8 @@ jobs: - name: Install Dependencies run: npm i --ignore-scripts --no-audit --no-fund - name: Check If Published + env: + RELEASES: \${{ inputs.releases }} run: | EXIT_CODE=0 @@ -4072,6 +4076,8 @@ jobs: - name: Install Dependencies run: npm i --ignore-scripts --no-audit --no-fund - name: Check If Published + env: + RELEASES: \${{ inputs.releases }} run: | EXIT_CODE=0