Skip to content

Commit

Permalink
fix: remote branch not detected
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRealWaldo committed Aug 7, 2021
1 parent 42e50d4 commit 9de163d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ try {
} else jsonOpts.git.requireUpstream = false;
info('Checking if remote branch exists');
remoteBranchExists = execSync(`git ls-remote --heads ${remoteRepo} ${createBranch}`).toString();
if (remoteBranchExists) {
if (remoteBranchExists === '') {
info(`Branch does not yet exist, creating branch ${createBranch}`);
execSync(`git checkout -b ${createBranch}`);
} else {
Expand All @@ -111,7 +111,7 @@ try {
setOutput('latestVersion', response.latestVersion);
setOutput('changelog', response.changelog);

if (remoteBranchExists) {
if (remoteBranchExists !== '') {
info(`Checking out remote branch ${createBranch}`);
execSync(`git checkout --track origin/${createBranch}`);

Expand Down

0 comments on commit 9de163d

Please sign in to comment.