Skip to content

style(why-nix): remove section backgrounds - #2065

Merged
thilobillerbeck merged 1 commit into
NixOS:mainfrom
Sigmanificient:why-nix/bg-remove
Jul 8, 2026
Merged

thilobillerbeck merged 1 commit into
NixOS:mainfrom
Sigmanificient:why-nix/bg-remove

Conversation

@Sigmanificient

@Sigmanificient Sigmanificient commented Jul 5, 2026 •

Copy link
Copy Markdown
Member

This is a one of the quick win improvements were less is more.

@Sigmanificient Sigmanificient changed the title content(why-nix): remove section backgrounds style(why-nix): remove section backgrounds Jul 5, 2026
@thilobillerbeck
thilobillerbeck merged commit f712671 into NixOS:main Jul 8, 2026
3 of 4 checks passed
thilobillerbeck pushed a commit that referenced this pull request Jul 21, 2026
This is a one of the quick win improvements were less is more.
thilobillerbeck added a commit that referenced this pull request Aug 11, 2026
## Problem

Every pull request from a fork has failed CI since 2026-06-22. `Check
nixos.org PR` errors after about four seconds, before any code is
fetched:

> Refusing to check out fork pull request code from a
'pull_request_target' workflow.

`build` and `publish` then skip, so fork PRs get no build and no Netlify
preview. The cause is the `actions/checkout` v7.0.0 bump in #2052: v7
refuses the `pull_request_target` plus fork-head checkout pattern
without an explicit opt-in.

The split is clean across every PR since then. Fork PRs #2056, #2065,
#2066, #2076, #2081 and #2084 all failed this way and were merged
anyway, so six community contributions have landed with no build and no
preview; #2059 and #2085 are still open and red. Same-repo PRs such as
#2068, #2074 and #2080 are unaffected, because the guard skips PRs whose
head repo is the base repo. That is also why dependabot never surfaced
the regression: its branches live in this repository.

## Fix

Set `allow-unsafe-pr-checkout: true` on the two steps that check out PR
code, restoring the fork previews added in #1709.

The guard exists because `pull_request_target` can expose the base
repository's token, secrets, and cache scope to untrusted code. None of
that applies here: `check` and `build` check out PR code but reference
no secrets and hold only `contents: read`, while `publish` holds the
Netlify credentials but has no checkout step and only downloads the
build artifact. This workflow also sets neither `production-branch` nor
`production-deploy`, so fork content can only ever reach a Netlify draft
deploy. The workflow uses no Actions cache, and the Cachix signing key
is confined to `deploy-prod.yml`. This is the separation already
recorded in `.github/zizmor.yml` as the reason `dangerous-triggers` is
ignored for this workflow.

I also commented both jobs, since the opt-in is only safe while they
stay free of secrets.

## Verification

- In checkout at the pinned SHA (v7.0.1), `assertSafePrCheckout` in
`src/unsafe-pr-checkout-helper.ts` returns as soon as the input is set,
before evaluating any other condition, so it removes this error
outright. The input is declared in that commit's `action.yml`.
- The guard is the only blocker: fork PRs fail inside the checkout step,
before any other step runs.
- Everything past checkout already works with these exact pins: #2080
ran on `pull_request_target` at 2026-07-21T21:08Z, about ten hours after
#2079 pinned v7.0.1, and `check`, `build`, `publish` and the preview all
passed.
- `actionlint` is clean, and `zizmor` reports no new findings under
either the default or the `--persona auditor` used by the pre-commit
hook.

Not verified: no fork PR has run with the flag. Since the guard returns
early when the head repo id equals the base repo id, a PR within my own
fork cannot reproduce the failure; that needs a fork owned by a second
account.

**This PR's own CI will still fail, which is expected.**
`pull_request_target` runs the workflow definition from the base branch,
so this PR runs main's unmodified copy. It cannot go green until merged.

## Alternative considered

The structural fix is to drop `pull_request_target`: `check` and `build`
on `pull_request`, `publish` on `workflow_run`, which is what the zizmor
comment anticipates. Not done here because `nwtgck/actions-netlify`
resolves the PR from `context.issue.number` and
`context.payload.pull_request`, both absent under `workflow_run` for
fork PRs, so it would silently stop commenting and attach the commit
status to the wrong SHA. That replaces the preview mechanism rather than
reconfiguring it. Happy to take it on separately.

---------

Co-authored-by: Thilo Billerbeck <thilo.billerbeck@officerent.de>
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