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

Settings gh-pages branch to current branch results in fatal Error: 'Refusing to fetch into current branch' #51

Closed
NathanielRN opened this issue Dec 11, 2020 · 3 comments · Fixed by #180

Comments

@NathanielRN
Copy link
Contributor

This action says in the documentation that if your docs build from your master branch you should simply set the gh-pages-branch to master to have it make a commit on that branch instead.

However, if you trigger the workflow while you are on the master branch itself, then because the action runs a git fetch <branch>:<branch> the action will fail with error:

/usr/bin/git -c user.name=github-action-benchmark -c user.email=github@users.noreply.github.com -c http.https://github.com/.extraheader= fetch origin master:master
fatal: Refusing to fetch into current branch refs/heads/master of non-bare repository
Error: Command 'git' failed with args '-c user.name=github-action-benchmark -c user.email=github@users.noreply.github.com -c http.https://github.com/.extraheader= fetch origin master:master': fatal: Refusing to fetch into current branch refs/heads/master of non-bare repository

See this workflow for an example.

Possible solutions include adding a field

should-fetch: true|false

to indicate whether the branch needs to be fetched before creating a commit.

Thank you for the awesome action!

@maximiliancsuk
Copy link

+1, having the same issue as well

@CanadaHonk
Copy link

skip-fetch-gh-pages exists now?

@alvicsam
Copy link
Contributor

@CanadaHonk it exists for 4 years already, just wasn't described in the readme. I created PR to fix it.

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

Successfully merging a pull request may close this issue.

4 participants