Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1644,8 +1644,10 @@ class GitHubHelper {
createOrUpdateRef(branchRepository, branch, newHead) {
return __awaiter(this, void 0, void 0, function* () {
const repository = this.parseRepository(branchRepository);
const branchExists = yield this.octokit.rest.repos
.getBranch(Object.assign(Object.assign({}, repository), { branch: branch }))
// Check the git ref directly rather than using the branches API, which
// follows branch rename redirects and can return a different branch.
const branchExists = yield this.octokit.rest.git
.getRef(Object.assign(Object.assign({}, repository), { ref: `heads/${branch}` }))
.then(() => true, () => false);
if (branchExists) {
core.info(`Branch ${branch} exists; Updating ref`);
Expand Down
1 change: 1 addition & 0 deletions report.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1794311051