Skip to content

Commit 21e62d8

Browse files
committed
publish: fix tag ending with "/"
1 parent 6b1fd9d commit 21e62d8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/publish.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ export async function publish(args) {
5353
if (!args.accessToken?.length) {
5454
logger.warn(`No access token provided. Publishing to registry ${args.registry} may fail.`);
5555
}
56+
// Remove slahes from the end of the tag (this may happen if the tag is provided by github ref_name
57+
if (args.tag?.includes("/")) {
58+
logger.warn(`Tag '${args.tag}' contains slashes: replacing with '-'`);
59+
args.tag = args.tag.replace(/\/+$/, '-');
60+
}
5661

5762
processPackageJson(packageDirectory, packageJson, { logger });
5863

0 commit comments

Comments
 (0)