You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For anyone suffering this issue, this might be the actions/checkout@v2 to blame. The default setting for checkout cannot work with push. To make them work together, you need to specify following parameters for checkout:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal tokenfetch-depth: 0# otherwise, you will failed to push refs to dest repo
Reacted by Charlie Winslow, Richard Bellamy, bryango, Matthew Feickert, Naka Masato, Oliver Kopp, Rickard Natt och Dag, Seb, zhenhua32, kyon and 13 more
Started: bash /home/runner/work/_actions/ad-m/github-push-action/master/start.sh
! [rejected] HEAD -> master (fetch first)
Push to branch master
error: failed to push some refs to '***github.com/sabuto/bot-test2.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
This makes no sense as i have pulled the latest version when i run the workflow, any ideas?
Thanks for this guys! and thanks for the fast responses :) i am happy for this to be closed as it works for me but will let you decide as the other haven't commented.
- Your workflow file was invalid: The pipeline is not valid. .github/workflows/update.yml (Line: 17, Col: 7): Unexpected value 'persist-credentials',.github/workflows/update.yml (Line: 18, Col: 7): Unexpected value 'fetch-depth'
Reacted by organizejs, bryango, Naka Masato, Oliver Kopp, Michael Hawker, Rickard Natt och Dag, Jon La Marr, Buchi Reddy Busi Reddy, Hieu Pham (Web SRE / Platform Pillar) and elv1s42
Activity
robot-o commentedon Feb 1, 2020
i'm having the same issue
magodo commentedon Feb 4, 2020
For anyone suffering this issue, this might be the
actions/checkout@v2to blame. The default setting forcheckoutcannot work withpush. To make them work together, you need to specify following parameters forcheckout:sabuto commentedon Feb 4, 2020
@magodo Thanks for this, I am now getting
This makes no sense as i have pulled the latest version when i run the workflow, any ideas?
ad-m commentedon Feb 4, 2020
@sabuto , add
force: true, but you should understand what that message mean in Git due risk of data loss.magodo commentedon Feb 4, 2020
Are you sure you set the fetch-depth to 0? I have this issue because of that.
sabuto commentedon Feb 4, 2020
Thanks for this guys! and thanks for the fast responses :) i am happy for this to be closed as it works for me but will let you decide as the other haven't commented.
Add checkout options to the example
organizejs commentedon Feb 22, 2020
@magodo
I am unable to set
persist-credentialsandfetch-depthas parameters under checkout.I'm setting it like so:
i get this error:
ad-m commentedon Feb 23, 2020
@organizejs , missing
with. Let's try:Adjusting checkout params as suggested from [issue](ad-m/github-push-…
StefMa commentedon Feb 26, 2020
Thanks guys, that worked for me.
But I get (together with my own commit) a second commit which is something like
Again, it seems that
checkout/v2does this.Another solution is to simple declare the branch you want to checkout:
fix: Try by specifying ref on checkout as found in github comment
fix: Try by specifying ref on checkout as found in github comment
fix: when updating changlelog push back to pull request (#56)
fix: fix error in github push
Test given GitHub issue: ad-m/github-push-action#44
Add checkout options to the example
Add checkout options to the example (#46)
fix: Set checkout GHA persist-credentials to false for push to succeed (
kenorb commentedon Jul 13, 2020
I've got the same issue with merge commit. Related: #20.
kenorb commentedon Jul 13, 2020
Related:
as per https://github.com/ad-m/github-push-action/issues/44\#issuecom…
as per https://github.com/ad-m/github-push-action/issues/44\#issuecom…
as per https://github.com/ad-m/github-push-action/issues/44\#issuecom…
🐛 refer to ad-m/github-push-action#44 (comment)
test: Testing git push solution
Set fetch-depth: 0
🐛 refer to ad-m/github-push-action#44 (comment)
🐛 refer to ad-m/github-push-action#44 (comment)