diff --git a/main.sh b/main.sh index c46c4d2..0963fb3 100755 --- a/main.sh +++ b/main.sh @@ -7,6 +7,7 @@ actor="$GITHUB_ACTOR" token="$INPUT_TOKEN" formula="$INPUT_FORMULA" url="$INPUT_URL" +mirror="$INPUT_MIRROR" sha256="$INPUT_SHA256" tag="$INPUT_TAG" revision="$INPUT_REVISION" @@ -32,11 +33,21 @@ if test -n "$tag" && test -n "$sha256"; then exit 1 fi +if test -n "$tag" && test -n "$mirror"; then + echo "Can't specify 'tag' and 'mirror' together" + exit 1 +fi + if test -n "$revision" && test -n "$sha256"; then echo "Can't specify 'revision' and 'sha256' together" exit 1 fi +if test -n "$revision" && test -n "$mirror"; then + echo "Can't specify 'revision' and 'mirror' together" + exit 1 +fi + if test -z "$url" && test -z "$tag" && test -z "$revision"; then echo "Need to specify 'url' with optional 'sha256', or 'tag' and 'revision'" exit 1 @@ -63,6 +74,9 @@ fi if test -n "$url"; then args+=(--url="$url") fi +if test -n "$mirror"; then + args+=(--mirror="$mirror") +fi if test -n "$sha256"; then args+=(--sha256="$sha256") fi