docusaurus: 2.0.0-beta.22 breaks cross-repo deploy to GitHub Pages
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Prerequisites
- I’m using the latest version of Docusaurus.
- I have tried the
npm run clear
oryarn clear
command. - I have tried
rm -rf node_modules yarn.lock package-lock.json
and re-installing packages. - I have tried creating a repro with https://new.docusaurus.io.
- I have read the console error message carefully (if applicable).
Description
Updating to docusaurus v2.0.0-beta.22 breaks my deployment to GitHub Pages.
The relevant commandline error follows:
[INFO] `git commit -m "Deploy website - based on 6f67bb9205e05e2d37ba6368e30774c48e6db78d"` code: 0
To github.com:yechs/website.git
! [remote rejected] master -> master (shallow update not allowed)
error: failed to push some refs to 'github.com:yechs/website.git'
[INFO] `git push --force origin master` code: 1
[ERROR] Deployment of the build output failed.
[ERROR] Error: Running "git push" command failed. Does the GitHub user account you are using have push access to the repository?
at runDeploy (/Users/yeshu/Coding/Personal/website/node_modules/@docusaurus/core/lib/commands/deploy.js:168:19)
at async Command.deploy (/Users/yeshu/Coding/Personal/website/node_modules/@docusaurus/core/lib/commands/deploy.js:189:13)
error Command failed with exit code 1.
According to the command line output, it looks like a shallow update problem. However, the weird thing is, docusaurus has been doing shallow clone deployments for almost a year now and has never failed before. Relevant PR: https://github.com/facebook/docusaurus/pull/5748
Logs
If you want a full log, there is one available from GitHub Actions (https://github.com/yechs/website/runs/7256462347)
And here is the successful log running yarn deploy
on v2.0.0-beta.21 three days ago (https://github.com/yechs/website/runs/7204294330)
Reproduction
Just to rule out the variables of GitHub Actions or GitHub changing their behavior:
I’ve ran yarn deploy
locally on v2.0.0-beta.22 and it failed with the same message.
I have also manually reverted back to v2.0.0-beta.21 and ran yarn deploy
, which functioned perfectly normal. (Note that it is doing the same shallow clone)
Reproducible demo
https://github.com/yechs/website/
Steps to reproduce
- Run
yarn deploy
- Observe that it fails
git checkout 193d6e0
to go back to docusaurus v2.0.0-beta.21- Run
yarn
to install dependencies - Run
yarn deploy
- Observe that it succeeds
Expected behavior
Deployment continues to function as in v2.0.0-beta.21
Actual behavior
Deployment fails. See log from GitHub Actions.
Your environment
- Public source code:
- Source code at https://github.com/yechs/website/
- Deployed to https://github.com/yechs/yechs.github.io/
- Public site URL:
- Docusaurus version used:
- v2.0.0-beta.22
- Environment name and version (e.g. Chrome 89, Node.js 16.4):
- Operating system and version (e.g. Ubuntu 20.04.2 LTS):
- Ubuntu (GitHub Actions) with Node v16
- MacOS with Node v16.15.1
- Arch Linux with Node v16.14.2
Self-service
- I’d be willing to fix this bug myself.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 4
- Comments: 18 (4 by maintainers)
Commits related to this issue
- Revert "feat(deploy): copy local git config to tmp repo (#7702)" This reverts commit ee376d19f6c5f2dd714c94941901665d2ce174a5. All git config fields can be set via the GIT_CONFIG_KEY_<n> and GIT_CON... — committed to ghostsquad/docusaurus by ghostsquad 2 years ago
- Revert "feat(deploy): copy local git config to tmp repo (#7702)" This reverts commit ee376d19f6c5f2dd714c94941901665d2ce174a5. All git config fields can be set via the GIT_CONFIG_KEY_<n> and GIT_CON... — committed to ghostsquad/docusaurus by ghostsquad 2 years ago
- Downgrade docusaurus Version 2.0.1 breaks the github actions deploy. Based on the issue below, docusaurus was working on 2.0.0-rc1. This commit downgrades docusuarus to the latter version. See: http... — committed to NethermindEth/juno by joshklop 2 years ago
- Downgrade docusaurus Version 2.0.1 breaks the github actions deploy. Based on the issue below, docusaurus was working on 2.0.0-rc.1. This commit downgrades docusuarus to the latter version. See: htt... — committed to NethermindEth/juno by joshklop 2 years ago
- Downgrade docusaurus (#326) Version 2.0.1 breaks the github actions deploy. Based on the issue below, docusaurus was working on 2.0.0-rc.1. This commit downgrades docusuarus to the latter version. ... — committed to NethermindEth/juno by joshklop 2 years ago
- Downgrade docusaurus (#326) Version 2.0.1 breaks the github actions deploy. Based on the issue below, docusaurus was working on 2.0.0-rc.1. This commit downgrades docusuarus to the latter version. ... — committed to NethermindEth/juno by joshklop 2 years ago
I guess you’ll have to wait until #7750 gets merged and hopefully they’ll release a hotfix soon enough
In my humble opinion, it would be counter-intuitive to copy git configs during deployment.
It should be up to the CI to set up the desired git configuration environment, either via environment variables or, in the case of more advanced configs such as gpg signing key, via global configuration
Still getting this error in 2.0.1.
Fixed in rc1, deploying works well again thx
I will wait for the beta.23 release.
@yechs I think you are right. I’ll file a revert for this.