Add use_api feature

So that you don't _need_ to checkout (clone) the repo to the worker
This commit is contained in:
Phil Jay
2023-10-18 23:44:09 +11:00
parent 27ee2a7786
commit 8b80e08158
4 changed files with 64 additions and 11 deletions

View File

@@ -27,6 +27,20 @@ if [[ "${pep440}" != 'false' && "${pep440}" != 'true' ]] ; then
input_errors='true'
fi
use_api="${use_api:-false}"
if [[ "${use_api}" != 'false' && "${use_api}" != 'true' ]] ; then
echo "🛑 Value of 'use_api' is not valid, choose from 'false' or 'true'" 1>&2
input_errors='true'
fi
if [[ "${use_api}" == 'true' ]] ; then
if [[ -z "${github_token:-}" ]] ; then
echo "🛑 'use_api' is true, but environment variable 'github_token' is not set" 1>&2
input_errors='true'
fi
fi
##==----------------------------------------------------------------------------
## MacOS compatibility - for local testing