Skip to content

2.0.0-beta.22 breaks cross-repo deploy to GitHub Pages #7744

@yechs

Description

@yechs

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn 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: #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

  1. Run yarn deploy
  2. Observe that it fails
  3. git checkout 193d6e0 to go back to docusaurus v2.0.0-beta.21
  4. Run yarn to install dependencies
  5. Run yarn deploy
  6. 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

Self-service

  • I'd be willing to fix this bug myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its execution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions