github-action-benchmark
github-action-benchmark copied to clipboard
Settings gh-pages branch to current branch results in fatal Error: 'Refusing to fetch into current branch'
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 [email protected] -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 [email protected] -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!
+1, having the same issue as well
skip-fetch-gh-pages exists now?
@CanadaHonk it exists for 4 years already, just wasn't described in the readme. I created PR to fix it.