Restore contents:write permission for docs deploy (fix gh-pages 403)#52
Merged
ChrisRackauckas merged 1 commit intoJun 21, 2026
Conversation
The CI-centralization migration dropped the `permissions:` block from the `Documentation.yml` caller job. Because the reusable `SciML/.github/.github/workflows/documentation.yml@v1` declares no permissions of its own, the caller job's permissions flow through to the `GITHUB_TOKEN` passed into Documenter's `deploydocs`. With no permissions block, that token is read-only and cannot push to the `gh-pages` branch, so the build succeeds but the deploy step fails with a 403. Add the same `permissions` block used by the proven fix in OrdinaryDiffEqOperatorSplitting.jl #90 (`actions: write`, `contents: write`, `statuses: write`) so the token can push to gh-pages. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Superseded by SciML/.github#102, which sets |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The docs build passes, but the
deploydocspush togh-pagesfails (403 / "Permission denied" /GITHUB_TOKENcannot push).Root cause
The CI-centralization migration dropped the
permissions:block from thebuildcaller job in.github/workflows/Documentation.yml. The job calls the centralized reusableSciML/.github/.github/workflows/documentation.yml@v1, which declares nopermissions:of its own. In GitHub Actions, when a reusable workflow declares no permissions, the caller job's permissions flow through to theGITHUB_TOKENit receives. With no permissions block on the caller, that token defaults to read-only and cannot push to thegh-pagesbranch, so the deploy step 403s while the build itself looks green.ColPrac uses the
GITHUB_TOKEN-based deploy path (noDOCUMENTER_KEY); Documenter'sdeploydocsauto-usesGITHUB_TOKENwhenDOCUMENTER_KEYis absent, so all that is needed is to grant the caller job write access.Fix
Add the
permissions:block to thebuildcaller job, mirroring the proven fix in OrdinaryDiffEqOperatorSplitting.jl #90:Verification
python3 -c "import yaml; yaml.safe_load(...)".master(where the token has the granted scope on PRs from a fork it is still read-only by design). The change is correct by matching the proven #90 pattern: it restores exactly the permissions aGITHUB_TOKEN-baseddeploydocsneeds to push togh-pages.warnonlywas not set.Please ignore until reviewed by @ChrisRackauckas