From 402f89036523a77b735c3c6249a6af5842769054 Mon Sep 17 00:00:00 2001 From: Christian Richter Date: Fri, 3 Sep 2021 15:04:32 +0200 Subject: [PATCH] Sanitize input Signed-off-by: Christian Richter --- ghrunner/README.md | 20 +++++++++++--------- ghrunner/entrypoint.sh | 10 +++++++++- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/ghrunner/README.md b/ghrunner/README.md index e77580b..a26447a 100644 --- a/ghrunner/README.md +++ b/ghrunner/README.md @@ -8,13 +8,15 @@ Supported arches are: - amd64 ## Environment variables +```terminal +| Variable | Values | default | +|------------+----------------------------------------+----------------| +| `TOKEN` | token for runner from github | | +| `ARCH` | arm, arm64, x64 | x64 | +| `OS` | linux,osx | linux | +| `ORG` | name of the github org | | +| `REPO` | name of the github repo | | +| `VERSION` | version of the github runner to user | 2.280.3 | +| `CHECKSUM` | checksum for the github runner version | valid checksum | +``` -| Variable | Values | default | -|-------------------------------------------------+----------------------------------------+------------------------------------------------------------------| -| `TOKEN` | token for runner from github | | -| `ARCH` | arm, arm64, x64 | x64 | -| `OS` | linux,osx | linux | -| `ORG` | name of the github org | | -| `REPO` | name of the github repo | | -| `VERSION` version of the github runner to user | 2.280.3 | | -| `CHECKSUM` | checksum for the github runner version | 69dc323312e3c5547ba1e1cc46c127e2ca8ee7d7037e17ee6965ef6dac3c142b | diff --git a/ghrunner/entrypoint.sh b/ghrunner/entrypoint.sh index 581667b..52361e8 100755 --- a/ghrunner/entrypoint.sh +++ b/ghrunner/entrypoint.sh @@ -6,8 +6,16 @@ ORG=${ORG:-dragonchaser} REPO=${REPO:-dockerhub-autobuild} OS=${OS:-linux} +if [ -z "${ORG}" ]; then + echo "missing ORG, bailing out!" +fi + +if [ -z "${REPO}" ]; then + echo "missing REPO, bailing out!" +fi + if [ -z "${TOKEN}" ]; then - echo "MISSING TOKEN, BAILING OUT!" + echo "missing TOKEN, bailing out!" exit 1 fi