Skip to content

Commit

Permalink
forbid prereleasing to npm tag @latest (#3927)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Feiyang1 committed Oct 13, 2020
1 parent 3c420b0 commit df27732
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/release/prerelease.ts
Expand Up @@ -65,6 +65,12 @@ export async function runPrerelease({
);
}

if (FORBIDDEN_TAGS.includes(npmTag)) {
throw Error(
`Publishing to npm tag ${npmTag} is not allowed for prereleases`
);
}

const sha = await getCurrentSha();
const updates = await getAllPackages();
const pkgJsons = await Promise.all(
Expand Down Expand Up @@ -97,6 +103,8 @@ export async function runPrerelease({
}
}

const FORBIDDEN_TAGS = ['latest', 'next', 'exp'];

interface PrereleaseOptions {
prereleaseName: string;
npmTag: string;
Expand Down

0 comments on commit df27732

Please sign in to comment.