mirror of
https://github.com/Borales/actions-yarn.git
synced 2026-03-28 08:22:16 +08:00
Merge pull request #5 from Embraser01/patch-1
Backport some changes from npm actions
This commit is contained in:
commit
5a59b2b2ae
@ -1,6 +1,6 @@
|
||||
FROM node:10-slim
|
||||
FROM node:10
|
||||
|
||||
LABEL version="1.0.0"
|
||||
LABEL version="1.1.0"
|
||||
LABEL repository="https://github.com/Borales/actions-yarn"
|
||||
LABEL homepage="https://github.com/Borales/actions-yarn"
|
||||
LABEL maintainer="Oleksandr Bordun <bordun.alexandr@gmail.com>"
|
||||
|
||||
@ -6,9 +6,16 @@ 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}"
|
||||
NPM_STRICT_SSL="${NPM_STRICT_SSL-true}"
|
||||
NPM_REGISTRY_SCHEME="https"
|
||||
if ! $NPM_STRICT_SSL
|
||||
then
|
||||
NPM_REGISTRY_SCHEME="http"
|
||||
fi
|
||||
|
||||
# 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"
|
||||
printf "//%s/:_authToken=%s\\nregistry=%s\\nstrict-ssl=%s" "$NPM_REGISTRY_URL" "$NPM_AUTH_TOKEN" "${NPM_REGISTRY_SCHEME}://$NPM_REGISTRY_URL" "${NPM_STRICT_SSL}" > "$NPM_CONFIG_USERCONFIG"
|
||||
|
||||
chmod 0600 "$NPM_CONFIG_USERCONFIG"
|
||||
fi
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user