Skip to content
This repository was archived by the owner on Feb 11, 2025. It is now read-only.

Commit 006efaa

Browse files
authored
Merge pull request #40 from fullstack-devops/bugfix/entrypoint-missidentyfied-vars
Update gh-entrypoint.sh
2 parents 760927e + a9ee1d7 commit 006efaa

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

images/base/helper-scripts/gh-entrypoint.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,20 @@ last_char="${GH_API_ENDPOINT: -1}"
1010
readonly _GH_API_ENDPOINT="${GH_API_ENDPOINT:-https://api.github.com}"
1111

1212
# Org/ Repo details
13-
if [ -z "$GH_ORG" ]; then
13+
if [ -n "$GH_ORG" ]; then
1414
readonly RUNNER_URL="${_GH_URL}/${GH_ORG}"
1515
readonly RUNNER_REG_TOKEN_URL="${_GH_API_ENDPOINT}/orgs/${GH_ORG}/actions/runners/registration-token"
16-
elif [ -z "$GH_REPO" ]; then
16+
elif [ -n "$GH_ORG" ] && [ -n "$GH_REPO" ]; then
1717
readonly RUNNER_URL="${_GH_URL}/${GH_ORG}/${GH_REPO}"
1818
readonly RUNNER_REG_TOKEN_URL="${_GH_API_ENDPOINT}/repos/${GH_ORG}/${GH_REPO}/actions/runners/registration-token"
19-
elif [ -z "$GH_ENTERPRISE" ]; then
19+
elif [ -n "$GH_ENTERPRISE" ]; then
2020
readonly RUNNER_URL="${_GH_URL}/${GH_ENTERPRISE}"
2121
readonly RUNNER_REG_TOKEN_URL="${_GH_API_ENDPOINT}/enterprises/${GH_ENTERPRISEs}/actions/runners/registration-token"
2222
else
23-
echo "Please provide Organisation detail by setting GH_ORG"
23+
echo "Please provide the following credentials:"
24+
echo " Repository: GH_ORG and GH_REPO"
25+
echo " Organisation: GH_ORG"
26+
echo " Enterprise: GH_ENTERPRISE"
2427
exit 255
2528
fi
2629

0 commit comments

Comments
 (0)