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

multi-execution fails due to "remote contains work that you do not have locally" #104

Closed
dhimmel opened this issue Feb 17, 2020 · 6 comments
Assignees
Labels
bug Something isn't working resolved

Comments

@dhimmel
Copy link
Contributor

dhimmel commented Feb 17, 2020

I am getting the following error when using the action (logs):

/usr/bin/git push origin gh-pages
To https:/dhimmel/rootstock-actions-deploy.git
 ! [rejected]        gh-pages -> gh-pages (fetch first)
error: failed to push some refs to '***github.com/dhimmel/rootstock-actions-deploy.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.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
##[error]Action failed with "Error: Error: The process '/usr/bin/git' failed with exit code 1"
##[error]Node run failed with exit code 1

I can't think of any reasons why this would be the case. Nothing should have pushed to the gh-pages branch from the time the action / job began. I don't think this is a case where multiple jobs were running at once causing a race condition.

Special considerations:

  1. The workflow uses peaceiris/actions-gh-pages@v3 multiple times. It is the second step using this action that fails.

  2. In the previous commit, there was no gh-pages branch in the repository. The action seems to have created the new gh-pages branch and then succeeded.

  3. I am attempting to use secrets.GITHUB_TOKEN on a public repository. The one commit that did get generated and pushed to gh-pages, does not seem to have triggered a GitHub Pages build, despite reports this is now working at About limitation of GITHUB_TOKEN #9 (comment).

@dhimmel dhimmel added the bug Something isn't working label Feb 17, 2020
@peaceiris
Copy link
Owner

Currently, this action does not support the multi-execution in one workflow.

I can fix this.

@peaceiris
Copy link
Owner

This issue is fixed by #109

@dhimmel Please try to use v3.0.4-0.

To avoid 3), we have to use deploy_key or personal_token.

dhimmel added a commit to dhimmel/rootstock-actions-deploy that referenced this issue Feb 18, 2020
@dhimmel
Copy link
Contributor Author

dhimmel commented Feb 18, 2020

Done in dhimmel/rootstock-actions-deploy@2c8f625 and the actions both succeeded in https:/dhimmel/rootstock-actions-deploy/runs/453415833. Thanks for adding multi-execution.

Will let you close when this change is in master.

To avoid 3), we have to use deploy_key or personal_token.

Yeah. I'm mostly interested in this point in figured out when github_token triggers Pages to see if we can guide Manubot users on how to use it successfully. Neither gh-pages commits at https:/dhimmel/rootstock-actions-deploy/commits/gh-pages have triggered a Pages build... so let me know if you want me to try something to that repo in case it's valuable for testing. (the repo is just a testing prototype so can make any changes).

@dhimmel
Copy link
Contributor Author

dhimmel commented Feb 18, 2020

let me know if you want me to try something to that repo in case it's valuable for testing

I went to settings and under GitHub Pages > Source, I re-selected "gh-pages branch". This option was already selected but when I selected it again, the GItHub Pages section expanded to include additional options and info like:

Your site is ready to be published at http://git.dhimmel.com/rootstock-actions-deploy/.

So maybe this is sometimes required when using GITHUB_TOKEN.

@peaceiris
Copy link
Owner

#109 has been merged, the v3.1.0 released, and the v3 tag updated.

We can close this issue.

I went to settings and under GitHub Pages > Source, I re-selected "gh-pages branch". This option was already selected but when I selected it again, the GItHub Pages section expanded to include additional options and info like:

Adding that notes to the README may be friendly for users. I opened #114

@dhimmel dhimmel closed this as completed Feb 19, 2020
@dhimmel dhimmel changed the title Error due to "remote contains work that you do not have locally" multi-execution fails due to "remote contains work that you do not have locally" Feb 19, 2020
@github-actions
Copy link
Contributor

This issue has been LOCKED because of it being resolved!

The issue has been fixed and is therefore considered resolved.
If you still encounter this or it has changed, open a new issue instead of responding to solved ones.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working resolved
Projects
None yet
Development

No branches or pull requests

2 participants