Skip to content

Commit

Permalink
feat: update repo url matching (#21)
Browse files Browse the repository at this point in the history
* Update grep regex for precise filtering of urls

* update source and destination repo regex

Regex derived from repo-sync/github-sync#30
  • Loading branch information
shakti-garg authored Nov 3, 2020
1 parent e07e85c commit c81b9ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions git-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SOURCE_BRANCH=$2
DESTINATION_REPO=$3
DESTINATION_BRANCH=$4

if ! echo $SOURCE_REPO | grep '.git'
if ! echo $SOURCE_REPO | grep -Eq ':|@|\.git\/?$'
then
if [[ -n "$SSH_PRIVATE_KEY" ]]
then
Expand All @@ -17,7 +17,7 @@ then
SOURCE_REPO="https://github.com/${SOURCE_REPO}.git"
fi
fi
if ! echo $DESTINATION_REPO | grep -E '.git|@'
if ! echo $DESTINATION_REPO | grep -Eq ':|@|\.git\/?$'
then
if [[ -n "$SSH_PRIVATE_KEY" ]]
then
Expand Down

0 comments on commit c81b9ea

Please sign in to comment.