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

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

Open
qwerttvv opened this issue Sep 14, 2023 · 2 comments
Open

Comments

@qwerttvv
Copy link

v1.9.0
e2c7edd

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

same issue here, works v1.3

@maze88
Copy link

maze88 commented Jul 16, 2024

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

    - uses: tgymnich/[email protected]
      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:

  • Require a pull request before merging
  • Require approvals (1)
  • Allow specified actors to bypass required pull requests (for the user associated with the token provided in the action's input above)
  • Restrict who can push to matching branches
  • Allow force pushes (my personal user and the user associated with the token provided in the action's input above)

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

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

3 participants