## Description
Secure depot caches shared across branches by preventing pull requests
from restoring cached artifacts that could contain malicious code. This
ensures that trusted runs (pushes to main, scheduled jobs) only look up
cache keys without restoring pull request-written content, while pull
requests can still benefit from caches written by trusted runs.
## Changes
- **ci.yaml**: Add `lookup-only` flag to golangci-lint and coder-e2e
cache restore steps for non-pull-request runs. Invert pnpm cache
condition to only restore on pull requests.
- **setup-mise/action.yml**: Add `lookup-only: true` to cache step on
main branch; change restore condition from `github.ref !=
'refs/heads/main'` to `github.event_name == 'pull_request'`.
- **pnpm-install/action.yml**: Add `lookup-only: true` to cache step on
main branch; change restore condition from `github.ref !=
'refs/heads/main'` to `github.event_name == 'pull_request'`.
- **eval-coder-agents.yaml**: Disable caching in setup-mise and setup-uv
for the eval job, which holds secrets and must not restore pull request
artifacts.
- **embedded-pg-cache/download/action.yml**: Restrict cache restore to
pull request runs only.
- **test-cache/download/action.yml**: Restrict cache restore to pull
request runs only.
All changes include explanatory comments documenting the security
rationale.
## Test Plan
CI workflows will validate the changes. The logic ensures:
- Pull requests can restore caches from trusted runs
- Trusted runs only look up keys without restoring pull request content
- Secret-holding jobs disable caching entirely
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The `run` job in `eval-coder-agents.yaml` checks out the PR's head and
runs its code, including its own `scripts/harbor-coder`. It currently
uses the `main` environment, which holds main-only secrets for other
workflows. This moves it to a dedicated `eval` environment, so only eval
secrets are ever in scope.
- **Depends on** coder/github-org-terraform#124, which creates `eval`
(only `main` may deploy, no reviewers, no admin bypass). Merge that
first; otherwise GitHub creates `eval` unprotected on the first run.
- **`EVAL_CODER_SESSION_TOKEN`:** the job references it, but it isn't
set in `main` today. When it's added, put it in `eval`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>