Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit dabd1e1

Browse files
author
David Dooling
committed
Create next distribution tag for prereleases
Rather than create a distribution tag with the tag name, assign the `next` tag to prereleases. [changelog:fixed]
1 parent 6b4f610 commit dabd1e1

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lib/events.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import * as pRetry from "p-retry";
3535
import * as path from "path";
3636
import * as semver from "semver";
3737
import { extractAnnotations } from "./annotation";
38-
import { cleanGitRef, gitRefToNpmTag, nextPrereleaseTag } from "./git";
38+
import { gitRefToNpmTag, nextPrereleaseTag } from "./git";
3939
import { Configuration } from "./configuration";
4040

4141
interface NpmParameters {
@@ -534,10 +534,15 @@ const NpmPublishStep: NpmStep = {
534534
args.push("--tag", gitRefToNpmTag(branch));
535535
} else {
536536
const tagVersion = semver.valid(tag.replace(/^v/, ""));
537-
if (!tagVersion || tagVersion.includes("-")) {
538-
args.push("--tag", cleanGitRef(tag));
537+
if (!tagVersion) {
538+
args.push("--tag", gitRefToNpmTag(tag, "tag"));
539+
} else if (tagVersion.includes("-")) {
540+
// prerelease
541+
args.push("--tag", "next");
542+
} else {
543+
// release
544+
args.push("--tag", "latest");
539545
}
540-
// no tag for release versions, so latest gets applied by default
541546
}
542547

543548
const check = await github.createCheck(ctx, params.project.id, {

0 commit comments

Comments
 (0)