Skip to content

Commit

Permalink
(delete.sh) Loggin repaired and made runner_name optional defaulting …
Browse files Browse the repository at this point in the history
…to hostname (actions#1871)

* Loggin repaired and made runner_name optional defaulting to hostname

* Update scripts/delete.sh

Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
  • Loading branch information
nikola-jokic and jsoref authored Nov 22, 2022
1 parent cc49e65 commit 6b84521
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/delete.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#/bin/bash
#!/bin/bash

set -e

Expand All @@ -12,7 +12,7 @@ set -e
#
# Usage:
# export RUNNER_CFG_PAT=<yourPAT>
# ./delete.sh scope name
# ./delete.sh <scope> [<name>]
#
# scope required repo (:owner/:repo) or org (:organization)
# name optional defaults to hostname. name to delete
Expand All @@ -26,17 +26,17 @@ set -e
runner_scope=${1}
runner_name=${2}

echo "Deleting runner ${runner_name} @ ${runner_scope}"

function fatal()
function fatal()
{
echo "error: $1" >&2
exit 1
}

if [ -z "${runner_scope}" ]; then fatal "supply scope as argument 1"; fi
if [ -z "${runner_name}" ]; then fatal "supply name as argument 2"; fi
if [ -z "${RUNNER_CFG_PAT}" ]; then fatal "RUNNER_CFG_PAT must be set before calling"; fi
if [ -z "${runner_name}" ]; then runner_name=`hostname`; fi

echo "Deleting runner ${runner_name} @ ${runner_scope}"

which curl || fatal "curl required. Please install in PATH with apt-get, brew, etc"
which jq || fatal "jq required. Please install in PATH with apt-get, brew, etc"
Expand Down

0 comments on commit 6b84521

Please sign in to comment.