mirror of
https://github.com/peter-evans/create-pull-request.git
synced 2026-12-02 04:40:29 +00:00
build: update distribution (#4526)
Co-authored-by: peter-evans <18365890+peter-evans@users.noreply.github.com>
This commit is contained in:
1 parent
77d56500d9
commit
3ffccacd46
1 file changed
+4
-2
Vendored
+4
-2
@@ -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`);
|
||||
|
||||
Reference in new issue
Block a user