Skip to content

Commit

Permalink
feat: validate parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
wei committed Aug 15, 2019
1 parent 1d08364 commit 1b02700
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
set -e

if [[ -z "$GITHUB_TOKEN" ]]; then
echo "Set the GITHUB_TOKEN environment variable."
exit 1
echo "Set the GITHUB_TOKEN environment variable."
exit 1
fi

if [[ -z "$SSH_PRIVATE_KEY" ]]; then
Expand Down
10 changes: 10 additions & 0 deletions github-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ set -e
UPSTREAM_REPO=$1
BRANCH_MAPPING=$2

if [[ -z "$UPSTREAM_REPO" ]]; then
echo "Missing \$UPSTREAM_REPO"
exit 1
fi

if [[ -z "$BRANCH_MAPPING" ]]; then
echo "Missing \$SOURCE_BRANCH:\$DESTINATION_BRANCH"
exit 1
fi

if ! echo $UPSTREAM_REPO | grep '\.git'
then
UPSTREAM_REPO="https://github.com/${UPSTREAM_REPO}.git"
Expand Down

0 comments on commit 1b02700

Please sign in to comment.