WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Example for setting automerge fails (with only one of my repositories) #646

@mvz

Description

@mvz

I've been using the automerge example for a long time, but with my latest repository, created from a template repository that also uses this mechanism, the automerge fails with the following error:

GraphQL: Pull request User is not allowed to push to this repository (enablePullRequestAutoMerge)

I have tried updating my automerge action to match the current example and it now looks like this (note that I don't have an if in the second step since I currently want all dependabot pull requests auto-merged):

name: Dependabot auto-merge
"on": pull_request

permissions:
  contents: write
  pull-requests: write

jobs:
  dependabot:
    runs-on: ubuntu-latest
    if: github.event.pull_request.user.login == 'dependabot[bot]'
    steps:
      - name: Dependabot metadata
        id: dependabot-metadata
        uses: dependabot/fetch-metadata@v2
      - name: Enable auto-merge for Dependabot PRs
        run: gh pr merge --auto --merge "${{github.event.pull_request.html_url}}"
        env:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

As far as I can tell, permissions on this repository are the same as the other ones. Any hints on how to debug this are appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions