tgymnich / fork-sync

🔄 Github action to sync your forks
MIT License
375 stars 82 forks source link

auto_approve error with v1.9.0 (Can not approve your own pull request) #153

Open qwerttvv opened 10 months ago

qwerttvv commented 10 months ago

v1.9.0 https://github.com/tgymnich/fork-sync/commit/e2c7edd2fa70502b27eb4ff7644fe8709d1c71cb

cfg with secrets.PERSONAL_TOKEN, Personal access tokens (classic) - repo, workflow

    uses: tgymnich/fork-sync@v1
    with:
      owner: Aleksoid1978
      repo: VideoRenderer
      base: master
      head: master
      auto_approve: true
      token: ${{ secrets.PERSONAL_TOKEN }}

cfg with secrets.GITHUB_TOKEN

    uses: tgymnich/fork-sync@v1
    with:
      owner: Aleksoid1978
      repo: VideoRenderer
      base: master
      head: master
      auto_approve: true
      token: ${{ secrets.GITHUB_TOKEN }}

error log

Run tgymnich/fork-sync@v1
  with:
    owner: Aleksoid1978
    repo: VideoRenderer
    base: master
    head: master
    auto_approve: true
    token: ***
    merge_method: merge
    pr_title: Fork Sync: Update from parent repository
    ignore_fail: false
    auto_merge: true
    retries: 4
    retry_after: 60
request failed after 4 retries with a delay of 60
Error: Failed to create or merge pull request: HttpError: Unprocessable Entity: "Can not approve your own pull request"

Allow auto-merge is select my repo: https://github.com/qwerttvv/MPC-VideoRenderer/ owner repo: https://github.com/Aleksoid1978/VideoRenderer

PikuZheng commented 7 months ago

same issue here, works v1.3

maze88 commented 5 days ago

I'm experiencing a similar issue, with version 2.0.10, with the following inputs:

    - uses: tgymnich/fork-sync@v2.0.10
      if: ${{ matrix.branch != '' }}
      with:
        owner: k8snetworkplumbingwg  # upstream
        head: master                 # upstream
        base: ${{ matrix.branch }}   # downstream
        pr_title: 'sync: from upstream master to ${{ matrix.branch }}'
        pr_message: 'Created by [*${{ github.job }}* workflow job](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) to sync changes from [upstream](${{ github.server_url }}/k8snetworkplumbingwg/${{ github.event.repository.name }}) to [downstream](${{ github.server_url }}/${{ github.repository }}).'
        retries: 1
        retry_after: 3
        token: ${{ secrets.GH_TOKEN_NVIDIA_CI_CD }}
        auto_approve: true
        auto_merge: true
        merge_method: rebase

Yields error:

Error: Failed to create or merge pull request: HttpError: Unprocessable Entity: "Can not approve your own pull request"

The example and documentation on the main readme may lack further details regarding Branch protection rules (etc.)...

In my case my protected branch has the following [potentially] relevant rules:

@tgymnich thanks in advanced, LMK if you need further details or anything else to aid troubleshooting!