Grant contents: write to docs deploy job to fix gh-pages 403#29
Closed
ChrisRackauckas-Claude wants to merge 1 commit into
Closed
Grant contents: write to docs deploy job to fix gh-pages 403#29ChrisRackauckas-Claude wants to merge 1 commit into
ChrisRackauckas-Claude wants to merge 1 commit into
Conversation
The centralized SciML documentation reusable workflow
(SciML/.github documentation.yml@v1) deploys to gh-pages via
`GITHUB_TOKEN || DOCUMENTER_KEY`. The reusable workflow declares no
`permissions:` block, so the GITHUB_TOKEN inherits the caller's
permissions. The caller had none, so the token defaulted to read-only
(Contents: read) and `deploydocs` failed with:
remote: Permission to SciML/LightweightStats.jl.git denied to github-actions[bot].
fatal: ... The requested URL returned error: 403
This repo has no DOCUMENTER_KEY secret, so deployment relies on the
GITHUB_TOKEN. The pre-migration CI.yml docs job granted
`contents: write` (last successful gh-pages deploy 2026-05-30); the
centralized-workflow migration dropped that, so every push-to-main
docs deploy has failed since. Restore the write permission at the
caller job level, which propagates to the reusable workflow's token.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
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
Documentation / Build and Deploy Documentationcheck has failed on every push tomainsince the migration to the centralized SciML reusable workflows (2026-06-02). The docs build fine; only the deploy step fails:(PR-event docs runs pass because they only build, never deploy — which is why only the
push-to-mainruns are red.)Root cause
The centralized reusable workflow
SciML/.github/.github/workflows/documentation.yml@v1deploys viaGITHUB_TOKEN || DOCUMENTER_KEYand declares nopermissions:block, so itsGITHUB_TOKENinherits the caller's permissions. The callerDocumentation.ymlalso declared none, so the token defaulted to read-only (Contents: read, confirmed in the job log). This repo has noDOCUMENTER_KEYsecret configured (actions/secretsreturnstotal_count: 0), so deployment must rely on theGITHUB_TOKEN— but a read-only token can't push togh-pages, hence the 403.Before the centralized-workflow migration, the repo's own
CI.ymldocs job granted:and deployed successfully (last good
gh-pagesbuild: 2026-05-30). The migration dropped those permissions.Fix
Restore
contents: write(plusstatuses: writefor commit-status updates) at the caller job level. Per GitHub Actions semantics, because the reusable workflow has nopermissions:block, these caller job-level permissions propagate to the reusable workflow'sGITHUB_TOKEN, givingdeploydocsthe push access it needs.This is the minimal change that restores the exact write permission the working pre-migration workflow had. (Alternatively an admin could configure a
DOCUMENTER_KEYSSH deploy key, like other SciML repos — but that requires admin access and a repo secret; this PR is the PR-fixable path.)Verification
Workflow-only change, no
.jlfiles (Runic N/A). Verified locally: YAML parses cleanly; thepermissionsblock is correctly placed at thejobs.documentationlevel; and the reusable workflow has nopermissions:block, so the caller's permissions are inherited. The deploy step only runs onpush/workflow_dispatchtomain(not on PR events), so the actual gh-pages push will be exercised once this lands onmain.Please ignore until reviewed by @ChrisRackauckas.