Skip to content

Restore contents:write permission for docs deploy (fix gh-pages 403)#76

Closed
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:fix-docs-deploy-permissions
Closed

Restore contents:write permission for docs deploy (fix gh-pages 403)#76
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:fix-docs-deploy-permissions

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor

Problem

The Documentation deploy fails on main. The docs build succeeds — the failure is in the deploydocs step, which pushes to gh-pages and gets a 403 / "Permission denied" (GITHUB_TOKEN cannot push).

Root cause

  • This repo has no DOCUMENTER_KEY secret, so Documenter's deploydocs falls back to pushing to gh-pages via GITHUB_TOKEN.
  • The CI-centralization migration replaced the old docs job with a thin caller of SciML/.github/.github/workflows/documentation.yml@v1 and dropped the permissions: block from the caller docs job.
  • The reusable workflow declares no workflow-level permissions, so for a uses: reusable-workflow job the caller job's permissions (now the default, read-only contents) flow through to the GITHUB_TOKEN used inside the called workflow. A read-only token cannot push to gh-pages → 403.

Fix

Add permissions: { actions: write, contents: write, statuses: write } to the caller docs job in .github/workflows/Documentation.yml. This restores the token-based deploy mechanism the repo depends on (no DOCUMENTER_KEY required). Mirrors the proven fix in SciML/OrdinaryDiffEqOperatorSplitting.jl#90 exactly.

  docs:
    name: "Documentation"
    permissions:
      actions: write
      contents: write
      statuses: write
    uses: "SciML/.github/.github/workflows/documentation.yml@v1"
    secrets: "inherit"

Verification

  • YAML validated locally with python3 yaml.safe_load (parses; the docs job carries the three permissions).
  • The deploy itself cannot be fully verified without a CI run on main (the gh-pages push only happens on a real main/tag run). The change is correct by matching the proven #90 pattern: it grants the caller job the same contents: write (plus actions/statuses write) that the reusable workflow needs to flow into the GITHUB_TOKEN.

This does not disable the docs check or set warnonly.

Please ignore until reviewed by @ChrisRackauckas

The Documentation deploy fails on main: the docs build succeeds but
deploydocs cannot push to gh-pages (403 / Permission denied).

The CI-centralization migration replaced the docs job with a thin caller
of SciML/.github/.github/workflows/documentation.yml@v1 and dropped the
permissions: block. This repo has no DOCUMENTER_KEY secret, so Documenter
deploys via GITHUB_TOKEN. The reusable workflow declares no permissions,
so the caller job's (default read-only contents) permissions flow through
to the token, which can no longer push to gh-pages.

Add permissions: { actions: write, contents: write, statuses: write } to
the caller docs job, restoring the token-based deploy mechanism. Mirrors
SciML/OrdinaryDiffEqOperatorSplitting.jl#90.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor Author

Superseded by SciML/.github#102, which sets permissions: contents: write in the centralized documentation.yml reusable itself — so no per-repo permissions block is needed once v1 is retagged. Closing this in favor of the central fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants