Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
joriswitteman opened this issue Jul 20, 2023 · 1 comment

Comments

@joriswitteman
Copy link

joriswitteman commented Jul 20, 2023

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
Copy link
Owner

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

    permissions:
      pull-requests: write
      contents: write

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants