Skip to content

chore(ci): authenticate Trigger.dev deploys with per-environment API keys - #9423

Merged
waleedlatif1 merged 1 commit into
stagingfrom
chore/trigger-env-api-keys
Oct 28, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
chore/trigger-env-api-keys

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Trigger.dev deploy and promote jobs read TRIGGER_ACCESS_TOKEN from an environment-scoped secret: TRIGGER_ACCESS_TOKEN_PROD on main, TRIGGER_ACCESS_TOKEN_STAGING on staging, TRIGGER_ACCESS_TOKEN_PREVIEW for the dev preview branch
  • Each falls back to the existing shared TRIGGER_ACCESS_TOKEN, so deploys keep working until the new secrets exist; the empty-token guards still fail fast
  • Environment API keys with Deploy only access belong to the project environment, not to a member, so they survive org membership changes (a personal access token does not)
  • Bumps the trigger.dev CLI and @trigger.dev/{sdk,core,build} from 4.5.16 to 4.7.6 (CLI and packages must match or the CLI aborts in CI):
    • 4.5.11 added env API keys for deploy, but promote only accepts them from 4.7.0
    • From 4.7.5 a --env that doesn't match the key's environment is an error; before, the deploy silently went to the key's environment
    • 4.7.6 is the newest release past the 7-day minimumReleaseAge
  • Promote needs the same write:deployments scope as deploy, so a Deploy only key covers both

Type of Change

  • Chore (CI / dependency)

Testing

  • actionlint on both workflows (no new findings)
  • Read the 4.5.16 → 4.7.6 changelogs for the CLI, SDK, core, and build: the changes are additive or limited to chat.agent, which this repo doesn't use; runtime is pinned to node-24, so the 4.7.2 default-runtime change doesn't apply; the zod override keeps 4.3.6
  • CI type-check, tests, and audits on this PR; the deploy path itself first runs on the next push to staging

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…keys

Map TRIGGER_ACCESS_TOKEN from TRIGGER_ACCESS_TOKEN_PROD/_STAGING/_PREVIEW,
falling back to the shared TRIGGER_ACCESS_TOKEN until those secrets exist.
Bump trigger.dev CLI and @trigger.dev/* to 4.7.6, the first line where
promote accepts environment API keys (4.7.0) and a mismatched --env errors
instead of deploying to the key's environment (4.7.5).
@waleedlatif1
waleedlatif1 requested a review from a team as a code owner October 28, 2026 22:15
@vercel

vercel Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Oct 28, 2026 10:24pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

This PR switches Trigger.dev deployments to separate keys for production, staging, and preview.

  • Trigger.dev releases use keys picked for their target environment.

No actionable issues were found. Deployment, installation, and runtime tests were not run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Main[main] --> Prod[Production key or shared token]
  Staging[staging] --> Stage[Staging key or shared token]
  Dev[dev] --> Preview[Preview key or shared token]
  Prod --> Upload[Upload without promotion]
  Stage --> Upload
  Upload --> Cutover[Wait for app traffic cutover]
  Cutover --> Promote[Promote uploaded version]
  Preview --> PreviewUpload[Upload dev-sim preview]
  PreviewUpload --> Fresh[Check dev branch is current]
  Fresh --> PreviewPromote[Promote preview version]
Loading

Reviews (1) · Last reviewed commit: "chore(ci): authenticate Trigger.dev depl..." · Reviewed by Greptile

@waleedlatif1
waleedlatif1 merged commit 94de080 into staging Oct 28, 2026
74 checks passed
@waleedlatif1
waleedlatif1 deleted the chore/trigger-env-api-keys branch October 28, 2026 23:10

This branch was successfully deployed

1 active deployment
Preview — 64ae720c Deployed Oct 28, 2026 by vercel[bot]
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.

1 participant