Skip to content

Commit 3a0bc9e

Browse files
tannevaledclaude
andauthored
ci: build the landing page on pull requests too (#4)
The workflow ran only on pushes to main, so a pull request touching the layout, the content or the Hugo version got no signal at all -- its checks read "no checks", which is not the same thing as green. Two changes, and only two: a pull_request trigger so the existing build job runs on every PR, and a guard on deploy so a pull request stops after building and uploading the artifact rather than replacing what is served. This file puts `environment:` before `needs:`, an ordering the other 192 landing pages do not use. The transform was taught that second shape rather than these three being edited by hand, and it still refuses anything it does not recognise -- an already-gated file is refused, and the 192 produce byte-identical output to before. Checked while here: HUGO_VERSION is pinned at 0.135.0, the same stale pin that had frozen go-filesystems.github.io at 15 cards when its template started using hugo.Data. This site does NOT use hugo.Data, builds identically on 0.135.0 and 0.162.1, and the live page matches the built output, so the pin is harmless here and is left alone. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent b2f86b2 commit 3a0bc9e

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎.github/workflows/hugo.yml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ name: Deploy Hugo site to Pages
77
on:
88
push:
99
branches: [main]
10+
# Build on every pull request too, so a change to the layout, the content or
11+
# the Hugo version has to prove the site still builds before it lands.
12+
# Without this the workflow ran only on main, which meant a dependency bump
13+
# arrived with no signal at all -- its checks read "no checks", which is not
14+
# the same thing as green and must not be merged as if it were.
15+
pull_request:
1016
workflow_dispatch:
1117

1218
# Allow only one concurrent deployment, skipping runs queued between
@@ -61,6 +67,10 @@ jobs:
6167
path: ./public
6268

6369
deploy:
70+
# Only main publishes. A pull request stops after build above: it has built
71+
# the site and uploaded the artifact, which is the whole point of the gate,
72+
# and it has no business replacing what is served.
73+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
6474
environment:
6575
name: github-pages
6676
url: ${{ steps.deployment.outputs.page_url }}

0 commit comments

Comments
 (0)