Default to providerBranch for manual VCS re-deployment

This commit is contained in:
hmacr
2025-07-22 12:42:28 +05:30
parent 2cecf08e3b
commit e412ec0ef2
2 changed files with 8 additions and 2 deletions
@@ -51,7 +51,10 @@
.vcs.listRepositoryBranches($installation.$id, selectedRepository);
const sorted = sortBranches(branchList.branches);
branch = sorted[0]?.name ?? null;
branch = sorted.find((b) => b.name === $func.providerBranch)
? $func.providerBranch
: (sorted[0]?.name ?? null);
if (!branch) {
branch = 'main';
@@ -57,7 +57,10 @@
.vcs.listRepositoryBranches($installation.$id, selectedRepository);
const sorted = sortBranches(branchList.branches);
branch = sorted[0]?.name ?? null;
branch = sorted.find((b) => b.name === site.providerBranch)
? site.providerBranch
: (sorted[0]?.name ?? null);
if (!branch) {
branch = 'main';