Skip to content

fix(ci): restore preview builds for fork PRs behind an approval gate - #3671

Merged
kolaente merged 2 commits into
mainfrom
fork-pull-request-workflow
Aug 30, 2026
Merged

fix(ci): restore preview builds for fork PRs behind an approval gate#3671
kolaente merged 2 commits into
mainfrom
fork-pull-request-workflow

Conversation

@tink-bot

Copy link
Copy Markdown
Collaborator

Preview build fails on every fork PR since actions/checkout v7: Refusing to check out fork pull request code from a 'pull_request_target' workflow.

Opt in via allow-unsafe-pr-checkout, but add gate. Fork controls Dockerfile and everything it RUNs, executing on runner that holds packages: write — so fork PRs now route to a preview-fork environment with required reviewers. Same-repo PRs use preview-trusted (no protection rules), build unattended as before.

Blocks merge: both environments must exist in repo settings first. GitHub auto-creates a missing environment unprotected, so preview-fork would silently pass through and forks would build ungated.

  • preview-trusted — no protection rules
  • preview-fork — required reviewers: @kolaente

How to verify

  1. Create the two environments in Settings → Environments as listed above.
  2. Open a pull request from a fork against this branch.
  3. Expected: the docker job of the Preview workflow reports "Waiting for review" and does not start until a required reviewer approves it. After approval the job runs to completion and the preview comment appears on the PR.
  4. Before this PR: the job failed at the Checkout step with Refusing to check out fork pull request code.

Then check a same-repo pull request:

  1. Push a branch to this repository and open a pull request from it.
  2. Expected: the docker job starts immediately with no approval prompt, and the preview comment appears as before.

actions/checkout v7 refuses to check out fork PR code under
pull_request_target unless allow-unsafe-pr-checkout is set, so every
fork PR failed the preview build.

Opt in, but gate the job on an environment for fork PRs only: a fork
controls the Dockerfile and everything it RUNs, which executes on a
runner holding packages: write. Same-repo PRs use an unprotected
environment and still build without a click.
@github-actions github-actions Bot added area/config config.yml, env vars, runtime flags, deployment config area/docker Dockerfile, image, docker-compose, healthcheck concern/regression Worked in a prior release, now broken labels Aug 30, 2026
The environment string form carries no url, so the PR timeline showed a
bare deployment entry. Point it at the pr-N preview to get a clickable
"View deployment" button.
@kolaente
kolaente merged commit 198c13c into main Aug 30, 2026
5 checks passed
@kolaente
kolaente deleted the fork-pull-request-workflow branch August 30, 2026 11:34
@github-actions

github-actions Bot commented Aug 30, 2026

Copy link
Copy Markdown

Preview Deployment

Preview deployments for this PR are available at:

URL Tag Commit
https://pr-3671.preview.vikunja.dev ghcr.io/go-vikunja/vikunja:pr-3671 latest
https://sha-e9d9cc5c4e065445fbb5c0ad7bab1758b401a405.preview.vikunja.dev ghcr.io/go-vikunja/vikunja:sha-e9d9cc5c4e065445fbb5c0ad7bab1758b401a405 e9d9cc5
https://sha-c29d9387e043f19f116d8e3f808811b103d564a6.preview.vikunja.dev ghcr.io/go-vikunja/vikunja:sha-c29d9387e043f19f116d8e3f808811b103d564a6 c29d938

The preview environment will start automatically on first visit. Subsequent pushes to this PR will update the pr-3671 image — the preview picks up the new version on restart. The per-commit URLs point to a specific version and will not change.

Run locally with Docker
docker pull ghcr.io/go-vikunja/vikunja:pr-3671
docker run -p 3456:3456 ghcr.io/go-vikunja/vikunja:pr-3671

Last updated for commit e9d9cc5

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

Labels

area/config config.yml, env vars, runtime flags, deployment config area/docker Dockerfile, image, docker-compose, healthcheck concern/regression Worked in a prior release, now broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants