From 543e6c9c337a9a8856ed5fc32e0c316b77d7107c Mon Sep 17 00:00:00 2001 From: AdrianGonz97 <31664583+AdrianGonz97@users.noreply.github.com> Date: Thu, 16 May 2024 11:01:33 -0400 Subject: [PATCH] tweak branch name logic --- dist/index.js | 2 +- src/cloudflare.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dist/index.js b/dist/index.js index 3e3d124..51e9c3d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -26518,7 +26518,7 @@ async function getPagesProject() { } async function createPagesDeployment(isProd) { const branch = config.branch || githubBranch; - const branchName = isProd || config.branch || prBranchOwner === void 0 ? branch : `${prBranchOwner}-${branch}`; + const branchName = config.branch ? config.branch : isProd || prBranchOwner === void 0 ? branch : `${prBranchOwner}-${branch}`; await src_default.in(import_node_path.default.join(process.cwd(), config.workingDirectory))` $ export CLOUDFLARE_API_TOKEN="${config.apiToken}" if ${config.accountId} { diff --git a/src/cloudflare.ts b/src/cloudflare.ts index 20500f7..3473503 100644 --- a/src/cloudflare.ts +++ b/src/cloudflare.ts @@ -29,8 +29,12 @@ export async function getPagesProject() { export async function createPagesDeployment(isProd: boolean) { const branch = config.branch || githubBranch; - const branchName = - isProd || config.branch || prBranchOwner === undefined ? branch : `${prBranchOwner}-${branch}`; + // use `config.branch` if it's set, otherwise, infer the name + const branchName = config.branch + ? config.branch + : isProd || prBranchOwner === undefined + ? branch + : `${prBranchOwner}-${branch}`; // TODO: Replace this with an API call to wrangler so we can get back a full deployment response object await shellac.in(path.join(process.cwd(), config.workingDirectory))`