File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -74,13 +74,13 @@ runs:
7474 REPO="self"
7575 REF=""
7676 CONFIG_PATH="${BASH_REMATCH[1]}"
77- elif [[ "$SOURCE" =~ ^@([^:]+ )(:.*)?$ ]]; then
78- # Just ref and optional path (e.g., "@main" or "@main:services/api" or "@main:")
77+ elif [[ "$SOURCE" =~ ^@([^:]* )(:.*)?$ ]]; then
78+ # Just ref and optional path (e.g., "@main" or "@main:services/api" or "@main:" or "@:path" )
7979 REPO="self"
8080 REF="${BASH_REMATCH[1]}"
8181 CONFIG_PATH="${BASH_REMATCH[2]#:}" # Remove : prefix
82- elif [[ "$SOURCE" =~ ^([^@:]+)(@[^:]+ )?(:.*)?$ ]]; then
83- # Standard format with repo
82+ elif [[ "$SOURCE" =~ ^([^@:]+)(@[^:]* )?(:.*)?$ ]]; then
83+ # Standard format with repo (allows empty ref like "repo@:path")
8484 REPO="${BASH_REMATCH[1]}"
8585 REF="${BASH_REMATCH[2]#@}" # Remove @ prefix
8686 CONFIG_PATH="${BASH_REMATCH[3]#:}" # Remove : prefix
Original file line number Diff line number Diff line change @@ -19,11 +19,11 @@ test_pattern() {
1919 REPO=" self"
2020 REF=" "
2121 CONFIG_PATH=" ${BASH_REMATCH[1]} "
22- elif [[ " $SOURCE " =~ ^@ ([^:]+ )(:.* )? $ ]]; then
22+ elif [[ " $SOURCE " =~ ^@ ([^:]* )(:.* )? $ ]]; then
2323 REPO=" self"
2424 REF=" ${BASH_REMATCH[1]} "
2525 CONFIG_PATH=" ${BASH_REMATCH[2]#: } "
26- elif [[ " $SOURCE " =~ ^([^@:]+)(@[^:]+ )? (:.* )? $ ]]; then
26+ elif [[ " $SOURCE " =~ ^([^@:]+)(@[^:]* )? (:.* )? $ ]]; then
2727 REPO=" ${BASH_REMATCH[1]} "
2828 REF=" ${BASH_REMATCH[2]#@ } "
2929 CONFIG_PATH=" ${BASH_REMATCH[3]#: } "
@@ -67,6 +67,11 @@ test_pattern "self:" "SHOULD_PASS"
6767test_pattern " Acme/configs:" " SHOULD_PASS"
6868test_pattern " Acme/configs@main:" " SHOULD_PASS"
6969
70+ # Empty ref patterns (missing ref value between @ and :)
71+ test_pattern " @:services/api" " SHOULD_PASS"
72+ test_pattern " acme-io/kubernetes@:platform-app" " SHOULD_PASS"
73+ test_pattern " Acme/configs@:" " SHOULD_PASS"
74+
7075# Other edge cases
7176test_pattern " :" " SHOULD_PASS"
7277test_pattern " @" " SHOULD_PASS"
You can’t perform that action at this time.
0 commit comments