Skip to content

Commit 1b02700

Browse files
committed
feat: validate parameters
1 parent 1d08364 commit 1b02700

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
set -e
44

55
if [[ -z "$GITHUB_TOKEN" ]]; then
6-
echo "Set the GITHUB_TOKEN environment variable."
7-
exit 1
6+
echo "Set the GITHUB_TOKEN environment variable."
7+
exit 1
88
fi
99

1010
if [[ -z "$SSH_PRIVATE_KEY" ]]; then

github-sync.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ set -e
55
UPSTREAM_REPO=$1
66
BRANCH_MAPPING=$2
77

8+
if [[ -z "$UPSTREAM_REPO" ]]; then
9+
echo "Missing \$UPSTREAM_REPO"
10+
exit 1
11+
fi
12+
13+
if [[ -z "$BRANCH_MAPPING" ]]; then
14+
echo "Missing \$SOURCE_BRANCH:\$DESTINATION_BRANCH"
15+
exit 1
16+
fi
17+
818
if ! echo $UPSTREAM_REPO | grep '\.git'
919
then
1020
UPSTREAM_REPO="https://github.com/${UPSTREAM_REPO}.git"

0 commit comments

Comments
 (0)