Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ jobs:
registry-url: https://registry.npmjs.org
scope: "@reflag"
package-manager-cache: false
- name: Use npm with OIDC dist-tag support
run: |
npm install --global npm@12.2.0
test "$(npm --version)" = "12.2.0"
- run: node --test scripts/v1-release.test.mjs
- name: Require the current protected v1 commit
shell: bash
Expand Down
14 changes: 14 additions & 0 deletions scripts/v1-release.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,17 @@ test("the maintenance publisher never selects latest", () => {
);
assert.match(seedJob, /run: node scripts\/v1-release\.mjs tag-legacy/);
});

test("legacy tag migration pins an OIDC-capable npm before changing tags", () => {
const workflow = readFileSync(
new URL("../.github/workflows/publish.yml", import.meta.url),
"utf8",
);
const seedJob = workflow.split(" legacy-tags:\n")[1];
const install = seedJob.indexOf("npm install --global npm@12.2.0");
const verify = seedJob.indexOf('test "$(npm --version)" = "12.2.0"');
const tag = seedJob.indexOf("node scripts/v1-release.mjs tag-legacy");
assert.ok(install >= 0, "Install npm with OIDC dist-tag support explicitly");
assert.ok(verify > install, "Verify the installed npm version");
assert.ok(tag > verify, "Require the pinned npm before changing tags");
});
Loading