Skip to content

Commit 40770a7

Browse files
authored
Merge pull request #2142 from hmacr/1we7-production-branch-for-github
Default to `providerBranch` for manual VCS re-deployment
2 parents 0a7254e + e412ec0 commit 40770a7

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/routes/(console)/project-[region]-[project]/functions/function-[function]/(modals)/createGit.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@
5151
.vcs.listRepositoryBranches($installation.$id, selectedRepository);
5252
5353
const sorted = sortBranches(branchList.branches);
54-
branch = sorted[0]?.name ?? null;
54+
55+
branch = sorted.find((b) => b.name === $func.providerBranch)
56+
? $func.providerBranch
57+
: (sorted[0]?.name ?? null);
5558
5659
if (!branch) {
5760
branch = 'main';

src/routes/(console)/project-[region]-[project]/sites/site-[site]/deployments/createGitDeploymentModal.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@
5757
.vcs.listRepositoryBranches($installation.$id, selectedRepository);
5858
5959
const sorted = sortBranches(branchList.branches);
60-
branch = sorted[0]?.name ?? null;
60+
61+
branch = sorted.find((b) => b.name === site.providerBranch)
62+
? site.providerBranch
63+
: (sorted[0]?.name ?? null);
6164
6265
if (!branch) {
6366
branch = 'main';

0 commit comments

Comments
 (0)