From b84634a6060fa2e6311114d80f480d81eb189921 Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Fri, 5 Jan 2024 22:51:16 +0100 Subject: [PATCH] Fix entrypoint --- entrypoint.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index c5e5add..a1d220d 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,8 +2,10 @@ branch=${PLUGIN_BRANCH:-"pages"} token_env=${PLUGIN_TOKEN_ENV} output=${PLUGIN_OUTPUT} -if [[ -z "$token_env" ]] || [[ -z "$branch" ]]; then - echo "Invalid configuration: Token environment variable name or branch name empty" +name=${PLUGIN_NAME} +email=${PLUGIN_EMAIL} +if [[ -z "$token_env" ]] || [[ -z "$branch" ]] || [[ -z "$name"]] || [[ -z "$email" ]]; then + echo "Invalid configuration: Token environment variable name, branch name empty, name, or email" exit 1 fi @@ -13,8 +15,8 @@ if [[ "$?" -ne "0" ]]; then exit 1 fi -[[ -n "$PLUGIN_EMAIL" ]] && git config --config user.email "$PLUGIN_EMAIL" -[[ -n "$PLUGIN_NAME" ]] && git config --config user.name "$PLUGIN_NAME" +git config --global user.email "$email" +git config --global user.name "$name" git config --global --add safe.directory "$CI_WORKSPACE/$CI_REPO_OWNER/$CI_REPO_NAME/$output" # Init a new repository in the output directory and add all files