Skip to content

Commit df27732

Browse files
authored
forbid prereleasing to npm tag @latest (#3927)
* forbid prereleasing to npm tag latest * add other tags that shouldn't be published to * remove canary from the forbidden list since it uses the prerelease flow
1 parent 3c420b0 commit df27732

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

scripts/release/prerelease.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ export async function runPrerelease({
6565
);
6666
}
6767

68+
if (FORBIDDEN_TAGS.includes(npmTag)) {
69+
throw Error(
70+
`Publishing to npm tag ${npmTag} is not allowed for prereleases`
71+
);
72+
}
73+
6874
const sha = await getCurrentSha();
6975
const updates = await getAllPackages();
7076
const pkgJsons = await Promise.all(
@@ -97,6 +103,8 @@ export async function runPrerelease({
97103
}
98104
}
99105

106+
const FORBIDDEN_TAGS = ['latest', 'next', 'exp'];
107+
100108
interface PrereleaseOptions {
101109
prereleaseName: string;
102110
npmTag: string;

0 commit comments

Comments
 (0)