Skip to content

Commit 695685e

Browse files
committed
Forbid empty inputs
1 parent cdb09ed commit 695685e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

build.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@ allow_empty_commits=$INPUT_ALLOW_EMPTY_COMMITS
1212
force_push=$INPUT_FORCE_PUSH
1313
ssh_keyscan_types=$INPUT_SSH_KEYSCAN_TYPES
1414

15+
assert_non_empty() {
16+
name=$1
17+
value=$2
18+
if [[ -z "$value" ]]; then
19+
echo "::error::Invalid Value: $name is empty." >&2
20+
exit 1
21+
fi
22+
}
23+
24+
assert_non_empty inputs.pkgname "$pkgname"
25+
assert_non_empty inputs.commit_username "$commit_username"
26+
assert_non_empty inputs.commit_email "$commit_email"
27+
assert_non_empty inputs.ssh_private_key "$ssh_private_key"
28+
1529
export HOME=/home/builder
1630

1731
echo '::group::Adding aur.archlinux.org to known hosts'

0 commit comments

Comments
 (0)