From a9ee1d7607ce1e6faf336053a2f1ea856e66ed97 Mon Sep 17 00:00:00 2001 From: Eike Haller <58111764+eksrha@users.noreply.github.com> Date: Thu, 27 Oct 2022 14:06:09 +0200 Subject: [PATCH] Update gh-entrypoint.sh --- images/base/helper-scripts/gh-entrypoint.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/images/base/helper-scripts/gh-entrypoint.sh b/images/base/helper-scripts/gh-entrypoint.sh index 379f44f..8e1f866 100755 --- a/images/base/helper-scripts/gh-entrypoint.sh +++ b/images/base/helper-scripts/gh-entrypoint.sh @@ -10,17 +10,20 @@ last_char="${GH_API_ENDPOINT: -1}" readonly _GH_API_ENDPOINT="${GH_API_ENDPOINT:-https://api.github.com}" # Org/ Repo details -if [ -z "$GH_ORG" ]; then +if [ -n "$GH_ORG" ]; then readonly RUNNER_URL="${_GH_URL}/${GH_ORG}" readonly RUNNER_REG_TOKEN_URL="${_GH_API_ENDPOINT}/orgs/${GH_ORG}/actions/runners/registration-token" -elif [ -z "$GH_REPO" ]; then +elif [ -n "$GH_ORG" ] && [ -n "$GH_REPO" ]; then readonly RUNNER_URL="${_GH_URL}/${GH_ORG}/${GH_REPO}" readonly RUNNER_REG_TOKEN_URL="${_GH_API_ENDPOINT}/repos/${GH_ORG}/${GH_REPO}/actions/runners/registration-token" -elif [ -z "$GH_ENTERPRISE" ]; then +elif [ -n "$GH_ENTERPRISE" ]; then readonly RUNNER_URL="${_GH_URL}/${GH_ENTERPRISE}" readonly RUNNER_REG_TOKEN_URL="${_GH_API_ENDPOINT}/enterprises/${GH_ENTERPRISEs}/actions/runners/registration-token" else - echo "Please provide Organisation detail by setting GH_ORG" + echo "Please provide the following credentials:" + echo " Repository: GH_ORG and GH_REPO" + echo " Organisation: GH_ORG" + echo " Enterprise: GH_ENTERPRISE" exit 255 fi