saitho / semantic-release-backmerge

:twisted_rightwards_arrows: semantic-release plugin to back-merge a release into a develop branch
https://saitho.github.io/semantic-release-backmerge/
56 stars 11 forks source link

bugfix: push with authorized url #28

Closed saitho closed 2 years ago

saitho commented 2 years ago

Error reproduced: https://github.com/saitho/backmerge-test/runs/3905294275?check_suite_focus=true Error fixed: https://github.com/saitho/backmerge-test/runs/3973108955

Note for GitHub Actions: This requires disabling persist-credentials in checkout action.

- uses: actions/checkout@v2
  with:
    persist-credentials: false

Please provide a repository admin/owner's authentication token at GITHUB_TOKEN with repo scope.

saitho commented 2 years ago

This doesn't work. I created a personal access token on my account (with all permissions possible) but it still failed:

remote: error: GH006: Protected branch update failed for refs/heads/develop.
remote: error: At least 1 approving review is required by reviewers with write access.

https://github.com/saitho/backmerge-test/runs/3913868589

Repo settings: repo-settings

Some people also report it's not working anymore here: https://github.community/t/how-to-push-to-protected-branches-in-a-github-action/16101/45

saitho commented 2 years ago

I tried:

EinfachHans commented 2 years ago

Mhh that's interesting. Any ideas why?

EinfachHans commented 2 years ago

Maybe add a console log in the first step to have a look if authedRepositoryUrl is correct? And/or run in debug mode?

EinfachHans commented 2 years ago

I also found this: https://stackoverflow.com/a/63733988/10908838

saitho commented 2 years ago

I also found this: https://stackoverflow.com/a/63733988/10908838

Setting persist-credentials: false for the checkout action did it. The token used for backmerge only needs to be the token of a repo owner/admin and requires repo scope.

I'll add a note in the documentation for that as well.