Skip to content

Commit

Permalink
main: add new mirror input
Browse files Browse the repository at this point in the history
  • Loading branch information
dawidd6 committed Mar 16, 2020
1 parent 809a4bd commit 26cd281
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 26cd281

Please sign in to comment.