The GH Action build-docs fails when trying to deploy to GH Pages in a PR. This happens because the runner does not have write permissions to the branch in a PR.
Proposed Solution:
Split the action into two separate workflows:
-
docs-build-and-check-links.yml (runs on PRs)
- Executes
make linkcheck to detect dead links.
- Executes
make html to check for documentation build issues.
-
docs-build-and-deploy.yml (runs on push)
- Runs the same checks as above.
- Deploys the documentation to GitHub Pages on push.
The GH Action
build-docsfails when trying to deploy to GH Pages in a PR. This happens because the runner does not have write permissions to the branch in a PR.Proposed Solution:
Split the action into two separate workflows:
docs-build-and-check-links.yml(runs on PRs)make linkcheckto detect dead links.make htmlto check for documentation build issues.docs-build-and-deploy.yml(runs on push)