Skip to content

Commit

Permalink
tweak branch name logic
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianGonz97 committed May 16, 2024
1 parent 5594171 commit 543e6c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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} {
Expand Down
8 changes: 6 additions & 2 deletions src/cloudflare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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))`
Expand Down

0 comments on commit 543e6c9

Please sign in to comment.