2
0
Fork 0

sh.zio.github-runner-wrapper: add Github Runner Wrapper

This commit is contained in:
Ducky 2023-12-03 02:33:53 +00:00
parent c952be0c12
commit 3a3dde0ff6
4 changed files with 56 additions and 0 deletions

View file

@ -0,0 +1,43 @@
#!/usr/bin/env bash
_PLUG_TITLE="GitHub Runner Wrapper"
_PLUG_DESCRIPTION=""
_PLUG_ARGS=(
"token;t;;string"
"url;u;;string"
"ex-version;;;string;2.311.0"
"ex-version-arch;;;string;x64"
)
_PLUG_POSITIONAL="url token"
function main() {
identifier="$(echo $_url | sed -e "s|https://github.com/||" -e "s|/|.|g")"
gh_runner_dir="$HOME/.local/bin/gh-runner_$identifier"
download_path="https://github.com/actions/runner/releases/download/v$_ex_version/actions-runner-linux-$_ex_version_arch-$_ex_version.tar.gz"
mkdir -p "$gh_runner_dir"
cd "$gh_runner_dir"
if [ -z "$(ls -A $gh_runner_dir)" ]; then
curl -o "actions-runner-linux-$_ex_version.tar.gz" -L "$download_path"
tar xzf "actions-runner-linux-$_ex_version.tar.gz"
rm "actions-runner-linux-$_ex_version.tar.gz"
fi
if [[ ! -f ".credentials" ]]; then
./config.sh --url "$url" --token "$token" --unattended
fi
./run.sh
}
if [[ $_PLUG_INVOKED != "true" ]]; then
base_dir="$(dirname "$(realpath -s "$0")")"
git_dir="$base_dir/../../.."
if [[ -d "$git_dir/.git" ]]; then
"$git_dir/usr/local/libexec/sodalite/invoker/src/invoke.sh" "$0" $@
else
"/usr/local/libexec/sodalite/invoker/src/invoke.sh" "$0" $@
fi
fi

@ -0,0 +1 @@
Subproject commit eab2016a970f6adbfdb1f8387e983ef54843b664