Skip to content

ci(preview): skip preview for fork PRs and harden workflow - #1198

Merged
edenreich merged 1 commit into
mainfrom
ci/preview-skip-fork-prs
Nov 12, 2026
Merged

edenreich merged 1 commit into
mainfrom
ci/preview-skip-fork-prs

Conversation

@edenreich

Copy link
Copy Markdown
Contributor

Why

Fork PRs don't receive repository secrets on pull_request events, so the preview job failed at the create-github-app-token step with an empty client-id (seen on PR #1196).

Changes

  • Run the preview and teardown jobs only when the PR head is in this repo (head.repo.full_name == github.repository). Fork PRs now show as skipped, not failed. The trigger stays pull_request - pull_request_target would build untrusted fork code with secrets available.
  • Pass the branch-derived alias and preview URL to run: steps through env instead of inline ${{ }} expressions, which closes a script-injection path through crafted branch names.
  • Set persist-credentials: false on both checkouts so GITHUB_TOKEN is not left in .git/config while bun install / bun run build run.

Testing

  • actionlint and prettier --check pass.
  • This PR is from a branch in this repo, so its own preview run exercises the deploy path.

Trade-off: fork PRs no longer get an automatic preview.

Fork PRs do not receive repository secrets, so the GitHub App token
step failed on every fork PR. Skip both preview jobs for forks, pass
the branch-derived alias through env instead of inline expressions,
and stop checkout from persisting the GITHUB_TOKEN.
@edenreich
edenreich requested a review from a team as a code owner November 12, 2026 00:06
@edenreich
edenreich merged commit ac9280e into main Nov 12, 2026
5 of 7 checks passed
@edenreich
edenreich deleted the ci/preview-skip-fork-prs branch November 12, 2026 00:07
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🗑️ Preview environment destroyed.

inference-gateway-releaser Bot added a commit that referenced this pull request Nov 12, 2026
## [0.9.26](0.9.25...0.9.26) (2026-11-12)

### 👷 CI

* **preview:** skip preview for fork PRs and harden workflow ([#1198](#1198)) ([ac9280e](ac9280e))

### 📚 Documentation

* **cli:** document infer tools list ([#1199](#1199)) ([7f9c924](7f9c924))
* **cli:** document workspace volumes in daemon.yaml ([#1189](#1189)) ([eafe773](eafe773))
* **cli:** skipping unchanged screen frames ([#1178](#1178)) ([1afabdf](1afabdf))
* **cli:** suggestions read the session's recent errors ([#1182](#1182)) ([745964b](745964b))
* **computer:** document Vulkan on the computer image ([#1197](#1197)) ([139a141](139a141))
* **desktop:** document local cluster folders ([#1193](#1193)) ([1703698](1703698))
* **desktop:** document volumes on a workspace ([#1191](#1191)) ([a53f2fb](a53f2fb))
* **desktop:** per-workspace computer, browser and recording switches ([#1185](#1185)) ([965a515](965a515))
* **desktop:** skipping unchanged screen frames ([#1180](#1180)) ([ce83ea8](ce83ea8))
* document the mirelo provider for sound-effect generation ([#1196](#1196)) ([3dcaa9a](3dcaa9a))
* **operator:** document spec.sandbox.volumes ([#1187](#1187)) ([a9db2ff](a9db2ff))

### 🔧 Miscellaneous

* **deps:** bump claude-code 2.1.308 -> 2.1.318 ([#1183](#1183)) ([3bf7796](3bf7796))
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.9.26 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant