gh-action-bump-version icon indicating copy to clipboard operation
gh-action-bump-version copied to clipboard

Version bump failed on protected branch

Open gyi123 opened this issue 2 years ago • 4 comments

I have set up a branch protection rule to run a few simple unit tests before code is merged. However, once the rule is enabled, I am having issue using the version bump. Here is the error messge in github action: ✖ fatal remote: error: GH006: Protected branch update failed for refs/heads/main.
remote: error: 2 of 2 required status checks are expected.

Any idea on how to resolve this? The protection rule is set up on pull request.

Thanks

George

gyi123 avatar Mar 18 '22 15:03 gyi123

I imagine you have a private Github Token, if that is the case, try this:

steps:
  - name: 'Checkout source code'
    uses: 'actions/checkout@v2'
    with:
        persist-credentials: false
        ref: ${{ github.ref }}
  - name: 'Automated Version Bump'
        id: version-bump
        uses: 'phips28/gh-action-bump-version@master'
        env:
            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

The secret is the persist-credentials: false on the checkout action.

leandrooriente avatar Apr 01 '22 12:04 leandrooriente

@leandrooriente does not work.

version action after first waterfall: patch
version action after final decision: patch
currentBranch: dev
current 1: 4.0.18 / version: patch
newVersion 1: 4.0.19
✖  fatal     fatal: could not read Username for 'https://github.com': No such device or address
git exited with code 1[28](https://github.com/webalys-hq/streamline-web/runs/6970316668?check_suite_focus=true#step:3:29)
✖  fatal     Failed to bump version

andirsun avatar Jun 20 '22 15:06 andirsun

@leandrooriente does not work.

version action after first waterfall: patch
version action after final decision: patch
currentBranch: dev
current 1: 4.0.18 / version: patch
newVersion 1: 4.0.19
✖  fatal     fatal: could not read Username for 'https://github.com': No such device or address
git exited with code 1[28](https://github.com/webalys-hq/streamline-web/runs/6970316668?check_suite_focus=true#step:3:29)
✖  fatal     Failed to bump version

I'm having this same issue in one repo, but not another. Same token, same action setup. It works in one repo, but fails with this same error in another. Any ideas? I'm using the latest version of the action, but have tried several of the past releases to no avail.

ph250167 avatar Jul 12 '22 12:07 ph250167

Having same issue with this action, tried to add persist-credentials: false - did not work. is there a fix/additional setting that needs to be made here?

OfirYaron avatar Nov 15 '23 07:11 OfirYaron

When adding persist-credentials: false im getting ✖ fatal fatal: could not read Username for 'https://github.com': No such device or address Otherwise, getting the same issue as OP. Any idea why that happens? @phips28

DannyBo-Affilomania avatar Mar 04 '24 17:03 DannyBo-Affilomania