Restore contents:write permission for docs deploy (fix gh-pages 403)#87
Closed
ChrisRackauckas-Claude wants to merge 1 commit into
Closed
Conversation
The CI-centralization migration replaced the docs job with a thin caller of
SciML/.github/.github/workflows/documentation.yml@v1 but dropped the
permissions: block. The reusable workflow declares no permissions, so the
caller job's (now default, read-only contents) permissions flow through to
the GITHUB_TOKEN used by Documenter's deploydocs. With no DOCUMENTER_KEY
secret, deploydocs falls back to a token-based gh-pages push, which the
read-only token cannot perform -> 403 / push denied.
Declaring permissions { actions: write, contents: write, statuses: write }
on the reusable-workflow caller job passes them through to the token,
restoring the token-based deploy mechanism. Mirrors the proven fix in
SciML/OrdinaryDiffEqOperatorSplitting.jl#90.
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 / push denied togithub-actions[bot]). The Documentation workflow uses the centralized reusableSciML/.github/.github/workflows/documentation.yml@v1withsecrets: "inherit"and noDOCUMENTER_KEYsecret, so Documenter falls back to a token-basedgh-pagespush usingGITHUB_TOKEN.Root cause
The CI-centralization migration replaced the docs job with a thin caller of
documentation.yml@v1but dropped thepermissions:block from the caller job. The reusable workflow declares nopermissions, so the caller job's permissions (now the default, read-onlycontents) flow through to theGITHUB_TOKENused inside the called workflow. A read-only token cannot push togh-pages-> 403.Fix
Declare
permissions: { actions: write, contents: write, statuses: write }on the reusable-workflow caller job inDocumentation.yml. For auses:reusable-workflow job, the caller job'spermissionsare passed through to theGITHUB_TOKENused inside the called workflow, restoring the token-based deploy mechanism. No secret is required.This mirrors the proven fix in SciML/OrdinaryDiffEqOperatorSplitting.jl#90 exactly.
Verification
python3 yaml.safe_load) — OK.master/a tag (gh-pages push only happens on the default branch / tags, not on PR builds). The fix is correct by matching the proven #90 pattern and the pre-migration permission set.Please ignore until reviewed by @ChrisRackauckas