Skip to content

Do not run the deploy step on pull requests - #23

Merged
cdiddens merged 1 commit into
pyoomph:mainfrom
cdiddens:skip-deploy-on-pr
Aug 7, 2026
Merged

Do not run the deploy step on pull requests#23
cdiddens merged 1 commit into
pyoomph:mainfrom
cdiddens:skip-deploy-on-pr

Conversation

@cdiddens

@cdiddens cdiddens commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Every PR from a fork so far (#19#22) has ended with a red X on Deploy Page. The cause is not the change under review: a fork PR gets a read-only GITHUB_TOKEN regardless of the permissions: contents: write declaration, so the build succeeds and only the final force-push to gh-pages fails:

remote: Permission to pyoomph/pyoomph.github.io.git denied to github-actions[bot].
fatal: ... The requested URL returned error: 403

Nothing was published by those runs and nothing could have been, so the failure carried no information — it just emailed a false alarm on every PR.

This gates the deploy step on the event:

if: github.event_name != 'pull_request'

The workflow still runs on PRs, and the Install and Build step still executes gen_page.sh — so the check now verifies the thing worth verifying on a PR, and a red X means the build is genuinely broken (e.g. an upstream readthedocs layout change tripping gen_example_gallery.py, which hard-fails by design). Publishing is unchanged: it happens on the push to main after the merge, where the token is writable.

CLAUDE.md documented the old behaviour and is updated to match.

Note: this PR's own check should be green — it is the first one that can be.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Fmhceke9votYhvWyGSBKyG

A PR from a fork only ever gets a read-only GITHUB_TOKEN, whatever the
permissions: contents: write declaration says, so the push to gh-pages
always failed with a 403 and marked the run red. Nothing was published
by those runs, and nothing could have been - see the runs on PRs pyoomph#19-pyoomph#22.

Gating the deploy step on the event turns the PR check into what is
actually useful there: it verifies that gen_page.sh still builds, which
would catch e.g. an upstream readthedocs layout change breaking
gen_example_gallery.py. Publishing still happens on push to main.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fmhceke9votYhvWyGSBKyG
@cdiddens
cdiddens merged commit e35bd5d into pyoomph:main Aug 7, 2026
1 check passed
@cdiddens
cdiddens deleted the skip-deploy-on-pr branch August 7, 2026 13:47
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.

1 participant