devmasx / merge-branch

A GitHub Action that merge PR branch to other branchs
161 stars 58 forks source link

Does this work with PRs from forks? #19

Open alanhartless opened 2 years ago

alanhartless commented 2 years ago

I'd like to implement this in our "read the docs" repository where contributors contribute PRs from their personal (public) forks. My goal is to auto merge labeled PRs into a development branch so that Read the Docs will auto-build the latest developer docs to make it easy to view content/changes introduced by PRs.

But I keep getting this error:

/usr/local/bundle/gems/octokit-4.14.0/lib/octokit/response/raise_error.rb:16:in `on_complete': POST https://api.github.com/repos/mautic/developer-documentation-new/merges: 403 - Resource not accessible by integration

I'm using the following for the action

name: Merge branch with labeled
on:
  pull_request:
    types: [labeled]
jobs:
  merge-branch:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master

      - name: Merge by labeled
        uses: devmasx/merge-branch@1.4.0
        with:
          label_name: 'review'
          target_branch: 'development'
          github_token: ${{ secrets.GITHUB_TOKEN }}

Any thoughts?

pegonzalezs commented 2 years ago

Hi @alanhartless , have you been able to progress in this issue? I'm currently facing the same problem. Thanks!

pegonzalezs commented 2 years ago

@alanhartless FYI. Did get over it creating a personal token and providing more permissions than standard GITHUB_TOKEN has.

For full info take a look here: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token

markcmiller86 commented 1 year ago

more permissions than standard GITHUB_TOKEN has

@pegonzalezs any chance you could elaborate...which permissions?