bbeesley / gha-auto-dependabot-rebase

Github Action to automatically request dependabot rebases
MIT License
12 stars 4 forks source link

GH Actions has no permissions to use rebase command, says Dependabot #515

Open joriswitteman opened 1 year ago

joriswitteman commented 1 year ago

I can't get Dependabot to accept rebase commands from the gh-actions bot:

Sorry, only users with push access can use that command.

If I follow up with a personal rebase comment manually, Dependabot accepts.

image

My workflow file:

name: Auto Rebase Dependabot PRs
on:
  push:
  release:
    types: [published]
jobs:
  auto-rebase:
    permissions:
      pull-requests: write
      contents: read
    name: Auto Rebase Dependabot PRs
    runs-on: ubuntu-latest
    if: ${{ github.actor == 'dependabot[bot]' }} && github.ref == 'refs/heads/main' || github.event == 'release'
    timeout-minutes: 5
    steps:
      - name: Request Rebase
        uses: "bbeesley/gha-auto-dependabot-rebase@main"
        env:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
        with:
          task: rebase
bbeesley commented 2 months ago

I believe when it says "push access" it means write permission, so you would need something like

    permissions:
      pull-requests: write
      contents: write