Support GITHUB_COM_TOKEN
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
decentral1se
2021-06-03 11:00:08 +02:00
parent 864d542175
commit e35cd60222
2 changed files with 42 additions and 1 deletions

29
entrypoint.sh Normal file
View File

@ -0,0 +1,29 @@
#!/bin/bash
set -e
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local def="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$def"
if [ "${!var:-}" ]; then
val="${!var}"
elif [ "${!fileVar:-}" ]; then
val="$(< "${!fileVar}")"
fi
export "$var"="$val"
unset "$fileVar"
}
file_env "GITHUB_COM_TOKEN"
exec "$@"