Skip to content

Commit

Permalink
fix getTargetCommit()
Browse files Browse the repository at this point in the history
  • Loading branch information
iTrooz committed Jul 22, 2024
1 parent d741be7 commit b314cdc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,13 +470,15 @@ async function getTargetCommit(target_commitish: string, releaser: Releaser, own
return target_commitish;
} else {
// assume it is a branch
let ref = await releaser.getRef({
let resp = await releaser.getRef({
owner: owner,
repo: repo,
ref: "heads/"+target_commitish,
})
console.log(ref);
return ref.object.sha;
if (resp.status == 404) {
throw new Error(`Branch ${target_commitish} not found`);
}
return resp.data.object.sha;
}
}

Expand Down

0 comments on commit b314cdc

Please sign in to comment.