peaceiris / actions-mdbook

GitHub Actions for mdBook (rust-lang/mdBook) ⚡️ Setup mdBook quickly and build your site fast. Linux (Ubuntu), macOS, and Windows are supported.

Home Page:https://github.com/marketplace/actions/mdbook-action

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: Couldn't open SUMMARY.md

NuroDev opened this issue · comments

commented

Describe the bug
Explicitly setting mdbook build path and instead resulting in the following error:

[ERROR] (mdbook::utils): Error: Couldn't open SUMMARY.md
[ERROR] (mdbook::utils): 	Caused By: No such file or directory (os error 2)

To Reproduce
Simply running the GitHub workflow

Expected behavior
mdbook build to run and complete.

Screenshots
If applicable, add screenshots to help explain your problem.

Your YAML file
nurodev/atlas/blob/master/.github/workflows/book.yml

Additional context
I have also done a sanity check and logged the current working directory when the step is run and it clearly shows that the book contents is present and ready to be build:

/home/runner/work/atlas/atlas/book
book.toml
custom.css
now.json
src
2020-01-08 16:54:46 [ERROR] (mdbook::utils): Error: Couldn't open SUMMARY.md
2020-01-08 16:54:46 [ERROR] (mdbook::utils): 	Caused By: No such file or directory (os error 2)
##[error]Process completed with exit code 101.

I am testing at https://github.com/peaceiris/test-NuroDev-atlas

It has failed with the same error, but https://github.com/peaceiris/test-mdbook have passed.
log

I cannot figure out why we get the error...

cargo install mdbook also failed. Log

I have created a new repository, new mdBook project using mdbook init and set up a workflow using this action. All steps have passed.

Log: https://github.com/peaceiris/test-mdbook-2/commit/5ac580dfcdb15490dfb99c49f8488220dc4fd669/checks

Workflow file: https://github.com/peaceiris/test-mdbook-2/blob/5ac580dfcdb15490dfb99c49f8488220dc4fd669/.github/workflows/github-pages.yml

commented

Ah okay, after some testing myself it looks like the issue is because the summary file name is case sensitive.
Changing my file from summary.md to SUMMARY.md fixed the error 🤦‍♂

I got it.

My local macOS machine has been formatted with case-insensitive mode, so the local building has passed and the remote building failed.

I'm experiencing the same but I do not even have any kind of SUMMARY.md in the current branch.

I am experiencing this same error.

Run mdbook test
Error: -13 07:13:09 [ERROR] (mdbook::utils): Error: Couldn't open SUMMARY.md in "/home/runner/work/fablore/fablore/src" directory
Error: -13 07:13:09 [ERROR] (mdbook::utils): 	Caused By: No such file or directory (os error 2)
Error: Process completed with exit code 101.

However I have a src/SUMMARY.md file, you can see it's right here.

@nathaneastwood I am not sure if this will help you, but in my case it was a misconfiguration error because I was missing the book.tolm file, and the -d . flag. Here is my somewhat shortened code:

      - name: Setup mdBook
        uses: peaceiris/actions-mdbook@v1
        with:
          mdbook-version: 'latest'

      - name: Generate Book
        run: |
          cat <<'EOF' > ./SUMMARY.md
          # Summary
          - [Readme](README.md)
          - [Config](CONFIG.md)
          - [Group accounts](GROUPS.md)
          EOF

      - name: Build Book
        run: mdbook build -d .

      - name: Deploy to github pages
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: .
          cname: xxx.com

Also, your book.toml looks almost identical to mine, except I have src = "."

Thanks for your suggestion @VladMasarik. Somehow this started working again. I didn't change anything in the .toml file or any other mdbook related setup files. I only added more content.

The issue is back