From 6e839006c1128851e9a370565db90628db637d74 Mon Sep 17 00:00:00 2001 From: Mikeal Rogers Date: Sat, 26 Jan 2019 21:51:06 +0000 Subject: [PATCH] init: template from npm action --- Dockerfile | 17 +++++++++++++++++ LICENSE | 0 README.md | 0 entrypoint.sh | 15 +++++++++++++++ 4 files changed, 32 insertions(+) create mode 100644 Dockerfile create mode 100644 LICENSE create mode 100644 README.md create mode 100644 entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..33dabdb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM node:10-slim + +LABEL version="1.0.0" +LABEL repository="http://github.com/mikeal/auto-release" +LABEL homepage="http://github.com/auto-release" +LABEL maintainer="Mikeal Rogers " + +LABEL com.github.actions.name="Automated releases for npm packages." +LABEL com.github.actions.description="Release npm package based on commit metadata." +LABEL com.github.actions.icon="package" +LABEL com.github.actions.color="red" +COPY LICENSE README.md / + +COPY "entrypoint.sh" "/entrypoint.sh" +ENTRYPOINT ["/entrypoint.sh"] +CMD ["help"] + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..10e7ac3 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,15 @@ +#!/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 + +sh -c "npx auto-release $*"