Skip to content

Commit 26cd281

Browse files
committed
main: add new mirror input
1 parent 809a4bd commit 26cd281

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

main.sh

+14
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ actor="$GITHUB_ACTOR"
77
token="$INPUT_TOKEN"
88
formula="$INPUT_FORMULA"
99
url="$INPUT_URL"
10+
mirror="$INPUT_MIRROR"
1011
sha256="$INPUT_SHA256"
1112
tag="$INPUT_TAG"
1213
revision="$INPUT_REVISION"
@@ -32,11 +33,21 @@ if test -n "$tag" && test -n "$sha256"; then
3233
exit 1
3334
fi
3435

36+
if test -n "$tag" && test -n "$mirror"; then
37+
echo "Can't specify 'tag' and 'mirror' together"
38+
exit 1
39+
fi
40+
3541
if test -n "$revision" && test -n "$sha256"; then
3642
echo "Can't specify 'revision' and 'sha256' together"
3743
exit 1
3844
fi
3945

46+
if test -n "$revision" && test -n "$mirror"; then
47+
echo "Can't specify 'revision' and 'mirror' together"
48+
exit 1
49+
fi
50+
4051
if test -z "$url" && test -z "$tag" && test -z "$revision"; then
4152
echo "Need to specify 'url' with optional 'sha256', or 'tag' and 'revision'"
4253
exit 1
@@ -63,6 +74,9 @@ fi
6374
if test -n "$url"; then
6475
args+=(--url="$url")
6576
fi
77+
if test -n "$mirror"; then
78+
args+=(--mirror="$mirror")
79+
fi
6680
if test -n "$sha256"; then
6781
args+=(--sha256="$sha256")
6882
fi

0 commit comments

Comments
 (0)