Skip to content

Commit 8010a91

Browse files
committed
fixed branch logic
1 parent 9efb222 commit 8010a91

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

dist/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37026,6 +37026,9 @@ async function updateFromSourceSpec(token, branch, autoMerge) {
3702637026
await exec.exec('git', ['config', 'user.email', 'github-actions@github.com']);
3702737027
core.info(`Creating and checking out branch: ${branch}`);
3702837028
await exec.exec('git', ['checkout', '-b', branch]);
37029+
const octokit = github.getOctokit(token);
37030+
const doesBranchExist = await branchExists(owner, repo, branch, octokit);
37031+
await setupBranch(branch, doesBranchExist);
3702937032
await runFernApiUpdate();
3703037033
const diff = await exec.getExecOutput('git', ['status', '--porcelain'], { silent: true });
3703137034
if (!diff.stdout.trim()) {

src/sync.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ async function updateFromSourceSpec(token: string, branch: string, autoMerge: bo
6363

6464
core.info(`Creating and checking out branch: ${branch}`);
6565
await exec.exec('git', ['checkout', '-b', branch]);
66+
67+
const octokit = github.getOctokit(token);
68+
const doesBranchExist = await branchExists(owner, repo, branch, octokit);
69+
await setupBranch(branch, doesBranchExist);
6670

6771
await runFernApiUpdate();
6872

0 commit comments

Comments
 (0)