Skip to content

Commit ddac3ee

Browse files
authored
INFRA-2849: Made extension work with release/x.y.z branch syntax (#116)
1 parent b39d2cf commit ddac3ee

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/scripts/create-platform-release-pr.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,16 @@ get_release_branch_name() {
9292
if [[ "$platform" == "mobile" ]]; then
9393
echo "release/${new_version}"
9494
elif [[ "$platform" == "extension" ]]; then
95-
echo "Version-v${new_version}"
95+
local candidate_primary="Version-v${new_version}"
96+
local candidate_alt="release/${new_version}"
97+
# Prefer Version-v... if it exists on origin; otherwise use release/... if present; else default to Version-v...
98+
if git ls-remote --heads origin "${candidate_primary}" | grep -q "."; then
99+
echo "${candidate_primary}"
100+
elif git ls-remote --heads origin "${candidate_alt}" | grep -q "."; then
101+
echo "${candidate_alt}"
102+
else
103+
echo "${candidate_primary}"
104+
fi
96105
fi
97106
}
98107

0 commit comments

Comments
 (0)