question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug] Probot throws error trying to squash and merge, when you can do it on Github UI

See original GitHub issue

Bug Report

Current Behavior A clear and concise description of the behavior.

  // Your code here
await github.pullRequests.merge(
            context.repo({
                number: pullRequest.number,
                commit_title: pullRequest.title,
                commit_message: commitMessage,
                merge_method: 'squash',
            })
        );

Expected behavior/code A clear and concise description of what you expected to happen (or code). The bot should merge the PR with ‘squash’ technique.

What is happening is that the bot is giving this error: Failed to merge PR: You're not authorized to push to this branch. Visit https://help.github.com/enterprise/2.12/user/articles/about-protected-branches/ for more information.

Why is this an issue?

Github allows them to squash and merge from the github UI, so as a consumer of a library, it is unclear why it would give us this error message. I doubt this is an issue in probot, however, not knowing where to create this ticket, I think this is a good place to start.

Environment

  • Probot version(s): [e.g. v7.0.0]
  • Node/npm version: [e.g. Node 8/npm 5]
  • OS: [e.g. Linux]

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
welcome[bot]commented, Aug 2, 2018

Thanks for opening this issue. A contributor should be by to give feedback soon. In the meantime, please check out the contributing guidelines and explore other ways you can get involved.

0reactions
jbhoosreddycommented, Aug 16, 2018

Thanks for the info. Really appreciate it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pull request "Squash and merge" button changes author details
The real workaround is for the maintainer to do the merge using the git command line instead of GitHub's UI, but then we...
Read more >
support merge_method options · Issue #13 - GitHub
Merges will fail if the repo is configured to disallow merge commits for PRs. Add an option to configure the merge_method to be...
Read more >
bot is not automatically merging · Issue #266 - GitHub
We do not have "Require branches to be up to date before merging" ... probot receives the status event and that the app...
Read more >
PullRequest "squash and merge" issue #9540 - GitHub
Can you reproduce the bug at https://try.gitea.io: ... The merge conflict is not strange, you squash merged your changes and then applied ...
Read more >
Squash commits skip DCO checks · Issue #126 - GitHub
Choose to do a 'Squash and Merge' for the pull request ( see below ) ... I think that might be out of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found