Repository navigation
Commit 8c04681
committed
fix: skip docs build/publish on pull_request, not just push
The sphinx job unconditionally ran (and tried to publish to gh-pages)
on every PR, including ones whose branch lives in a fork -- even the
author's own fork (e.g. #198). GitHub Actions always issues a
read-only GITHUB_TOKEN for pull_request-triggered runs when the head
repo differs from the base repo, so the gh-pages push step there fails
by design, regardless of repo/workflow permission settings.
There was already a commented-out attempt at this exact guard inside
sphinx.yml itself (`if: github.event_name != 'pull_request'`), but it
could never have worked there: sphinx.yml is invoked via
`workflow_call`, and github.event_name inside a called workflow is
always "workflow_call", never the original triggering event. Moving
the condition to the caller job in master.yml (which does see the real
triggering event) is what actually works -- removed the dead comment
from sphinx.yml accordingly.
This also means PR runs no longer spend ~10+ minutes building docs
that were never going anywhere, and unreviewed PR content never
reaches the live public docs site.1 parent f6a572c commit 8c04681
2 files changed
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
81 | 86 | | |
| 87 | + | |
82 | 88 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
0 commit comments