Skip to content

Commit ab1f5cf

Browse files
committed
fix: Make sure registry url ends with a /
1 parent 4ac06a4 commit ab1f5cf

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

entrypoint.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export NPM_STRICT_SSL="${INPUT_NPM_STRICT_SSL:-"$NPM_STRICT_SSL"}"
2525
NPM_STRICT_SSL="${NPM_STRICT_SSL:-"true"}"
2626
NPM_REGISTRY_SCHEME="https"
2727
if ! [ "$NPM_STRICT_SSL" = "true" ]; then NPM_REGISTRY_SCHEME="http"; fi
28-
NPM_REGISTRY_DOMAIN="$(echo "${NPM_REGISTRY_URL:-registry.npmjs.org}" | sed -r 's/https?:\/\///')"
28+
NPM_REGISTRY_DOMAIN="$(echo "${NPM_REGISTRY_URL:-registry.npmjs.org}" | sed -r 's/https?:\/\///' | sed -r 's/\/+$//')"
2929
NPM_REGISTRY_URL="${NPM_REGISTRY_SCHEME}://$NPM_REGISTRY_DOMAIN"
3030
NPM_CONFIG_USERCONFIG="${NPM_CONFIG_USERCONFIG:-"$HOME/.npmrc"}"
3131

@@ -40,7 +40,7 @@ if [ -n "$NPM_CUSTOM_NPMRC" ]; then
4040
echo "$NPM_CUSTOM_NPMRC" > "$NPM_CONFIG_USERCONFIG"
4141
chmod 0600 "$NPM_CONFIG_USERCONFIG"
4242
elif [ -n "$NPM_AUTH_TOKEN" ]; then
43-
printf "//%s/:_authToken=%s\\nregistry=%s\\nstrict-ssl=%s" "$NPM_REGISTRY_DOMAIN" "$NPM_AUTH_TOKEN" "$NPM_REGISTRY_URL" "$NPM_STRICT_SSL" > "$NPM_CONFIG_USERCONFIG"
43+
printf "//%s/:_authToken=%s\\nregistry=%s\\nstrict-ssl=%s" "$NPM_REGISTRY_DOMAIN" "$NPM_AUTH_TOKEN" "${NPM_REGISTRY_URL}/" "$NPM_STRICT_SSL" > "$NPM_CONFIG_USERCONFIG"
4444
chmod 0600 "$NPM_CONFIG_USERCONFIG"
4545
fi
4646

src/merge-release-run.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ function isMinorChange(message) {
8585
return minorTagsRegex.test(firstLine);
8686
}
8787

88-
const registryUrl = process.env.NPM_REGISTRY_URL || 'https://registry.npmjs.org/';
88+
let registryUrl = process.env.NPM_REGISTRY_URL || 'https://registry.npmjs.org/';
89+
if (!registryUrl.endsWith('/')) {
90+
registryUrl = `${registryUrl}/`;
91+
}
8992
const getFromRegistry = bent('json', registryUrl);
9093
const event = JSON.parse(fs.readFileSync('/github/workflow/event.json').toString());
9194
const deployDir = path.join(process.cwd(), process.env.DEPLOY_DIR || '.');

0 commit comments

Comments
 (0)