gh-action-bump-version/entrypoint.sh

21 lines
640 B
Bash
Raw Normal View History

2019-01-26 21:51:06 +00:00
#!/bin/sh
set -e
if [ -n "$NPM_AUTH_TOKEN" ]; then
# Respect NPM_CONFIG_USERCONFIG if it is provided, default to $HOME/.npmrc
NPM_CONFIG_USERCONFIG="${NPM_CONFIG_USERCONFIG-"$HOME/.npmrc"}"
NPM_REGISTRY_URL="${NPM_REGISTRY_URL-registry.npmjs.org}"
# Allow registry.npmjs.org to be overridden with an environment variable
printf "//%s/:_authToken=%s\\nregistry=%s" "$NPM_REGISTRY_URL" "$NPM_AUTH_TOKEN" "$NPM_REGISTRY_URL" > "$NPM_CONFIG_USERCONFIG"
chmod 0600 "$NPM_CONFIG_USERCONFIG"
fi
2019-05-23 19:01:06 +00:00
if [ "$GITHUB_REPOSITORY" = "mikeal/merge-release" ]
then
2019-05-23 19:08:29 +00:00
sh -c "node merge-release-run.js $*"
else
sh -c "npx merge-release $*"
fi