Skip to content

Commit

Permalink
fix: use current branch calculator
Browse files Browse the repository at this point in the history
  • Loading branch information
lshadler committed Oct 21, 2021
1 parent d4ade35 commit 4a86176
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions packages/core/src/auto.ts
Expand Up @@ -1685,9 +1685,7 @@ export default class Auto {
options: IShipItOptions
): Promise<ShipitInfo | undefined> {
const latestTag = await this.git?.getLatestTagInBranch(
env.branch ||
getCurrentBranch() ||
""
getCurrentBranch() || ""
);
const result = await this.publishFullRelease({
...options,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/utils/get-current-branch.ts
Expand Up @@ -10,9 +10,9 @@ export function getCurrentBranch() {
// env-ci sets branch to target branch (ex: main) in some CI services.
// so we should make sure we aren't in a PR just to be safe

if (isPR && "prBranch" in env) {
if (isPR && "prBranch" in env && env.prBranch) {
branch = env.prBranch;
} else {
} else if(env.branch) {
branch = env.branch;
}

Expand Down

0 comments on commit 4a86176

Please sign in to comment.