merge-branch icon indicating copy to clipboard operation
merge-branch copied to clipboard

Does this work with PRs from forks?

Open alanhartless opened this issue 4 years ago • 3 comments
trafficstars

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/[email protected]
        with:
          label_name: 'review'
          target_branch: 'development'
          github_token: ${{ secrets.GITHUB_TOKEN }}

Any thoughts?

alanhartless avatar Oct 20 '21 20:10 alanhartless

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

pegonzalezs avatar Jan 26 '22 13:01 pegonzalezs

@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

pegonzalezs avatar Jan 27 '22 09:01 pegonzalezs