Skip to content

Commit c81b9ea

Browse files
authored
feat: update repo url matching (#21)
* Update grep regex for precise filtering of urls * update source and destination repo regex Regex derived from repo-sync/github-sync#30
1 parent e07e85c commit c81b9ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: git-sync.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SOURCE_BRANCH=$2
77
DESTINATION_REPO=$3
88
DESTINATION_BRANCH=$4
99

10-
if ! echo $SOURCE_REPO | grep '.git'
10+
if ! echo $SOURCE_REPO | grep -Eq ':|@|\.git\/?$'
1111
then
1212
if [[ -n "$SSH_PRIVATE_KEY" ]]
1313
then
@@ -17,7 +17,7 @@ then
1717
SOURCE_REPO="https://github.com/${SOURCE_REPO}.git"
1818
fi
1919
fi
20-
if ! echo $DESTINATION_REPO | grep -E '.git|@'
20+
if ! echo $DESTINATION_REPO | grep -Eq ':|@|\.git\/?$'
2121
then
2222
if [[ -n "$SSH_PRIVATE_KEY" ]]
2323
then

0 commit comments

Comments
 (0)