Fix documentation deployment (switch to HTTPS via GITHUB_TOKEN)#142
Fix documentation deployment (switch to HTTPS via GITHUB_TOKEN)#142
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes the GitHub Actions documentation deployment path by switching Documenter to use GITHUB_TOKEN (HTTPS) rather than the SSH deploy-key path, and updates workflow dependencies accordingly.
Changes:
- Update docs workflow to use
actions/checkout@v4andjulia-actions/setup-julia@v2. - Remove
DOCUMENTER_KEYfrom the docs deploy environment and rely onGITHUB_TOKEN. - Add ignore rules for docs build artifacts and Claude-related local files.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.gitignore |
Ignores docs/build/ and Claude-related local artifacts. |
.github/workflows/Documentation.yml |
Switches docs deployment auth strategy to HTTPS via GITHUB_TOKEN and updates action versions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.github/workflows/Documentation.yml
Outdated
| if: github.event_name != 'pull_request' | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token | ||
| DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| PYTHON: "" |
There was a problem hiding this comment.
Because this workflow runs on pull_request and the job requests contents: write, a PR from a branch in the same repo would execute untrusted code with a write-capable GITHUB_TOKEN. Consider restructuring into two jobs: a PR-safe build job with read-only permissions, and a deploy job (push/tag only) that has contents: write and pushes to gh-pages. This also aligns with separating build vs deploy logic.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Summary
DOCUMENTER_KEYfrom the workflow env — its presence caused Documenter to use the SSH code path, which failed withgit@github.com: Permission denied (publickey)since no valid deploy key was configuredif: github.event_name != 'pull_request'guard so deployment is skipped on PRs (docs still build to catch errors)actions/checkout@v2→@v4andjulia-actions/setup-julia@v1→@v2PYTHON: ""into the build step (needed sincemake.jlcallsPlots.pyplot())Test plan
masterand confirm the Documentation workflow completes without thegit fetch upstreamSSH errorgh-pagesbranch is updated and docs appear at the expected URL🤖 Generated with Claude Code