Replies: 6 comments 6 replies
-
I get the same error using the following workflow: name: Dependabot auto-merge
on: pull_request
permissions:
pull-requests: write
contents: write
issues: write
repository-projects: read
jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- run: |
gh pr review --approve "$PR_URL"
gh pr edit --add-label "automerge" "$PR_URL"
gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} I also tried The PR is approved and tagged, but the last sentence, Any clue what is wrong? Thanks |
Beta Was this translation helpful? Give feedback.
-
The error message you're encountering is "GraphQL: ['Pull request: User is not authorized for this protected branch'] (enablePullRequestAutoMerge)," indicates that your GitHub app does not have the necessary permissions to enable auto-merge on a pull request. To resolve this issue, you'll need to ensure that your GitHub app has the required permissions to perform this action. Here are the steps you can take:
If you've already verified the above and are still facing issues, you might want to reach out to GitHub Support for further assistance, as they can provide more specific guidance based on your GitHub app's configuration and the repository settings. Additionally, ensure that your GitHub app is correctly authenticated and authorized when making API calls to enable auto-merge on pull requests. #67124 |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
The problematic option (now it's obvious.. 🥲 ) was Is there any way to include Thanks everyone for your help! |
Beta Was this translation helpful? Give feedback.
-
same question here |
Beta Was this translation helpful? Give feedback.
-
Has this been addressed yet? |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
I'm trying to setup a workflow that create a PR and enable auto-merge on it. I've followed the steps laid out here, but for my own bot (not dependabot). This bot does have
content: write
&pull-requests: write
permissions.The error I get is
GraphQL: ["Pull request User is not authorized for this protected branch"] (enablePullRequestAutoMerge)
Beta Was this translation helpful? Give feedback.
All reactions