Configure trust
- Select Staging, Preview, or Production, then open Trusted publishing under Security.
- Enter the Organization or user and Repository, then click Save. This repository configuration applies to the whole project.
- Click Enable for the selected environment. Choose a Scope by option (see Scope and additional claims), then click Save to allow publishing.
- Configure each environment separately. Preview settings apply to all Preview branches.
Pin GitHub identities
Both fields accept a name alone or a name followed by@ID:
Pinning IDs is recommended: names can be reused after renames, transfers, or deletions. Without an ID, the corresponding name is checked instead.
Look up both IDs with the GitHub CLI, using an account with access to the repository:
repository_owner_id; the repository uses repository_id. These IDs are not secrets. GitHub Actions also exposes them as GITHUB_REPOSITORY_OWNER_ID and GITHUB_REPOSITORY_ID.
Scope and additional claims
Choose one scope:- Any branch or tag: no ref restriction.
- Branch: a branch name such as
mainorrelease/*. - Tag: a tag name such as
v1.0.0orv*. - Environment: an exact GitHub Environment name such as
production. Setenvironment: productionon the workflow job and use GitHub’s required reviewers or other protections.
* wildcards. Do not include the refs/heads/ or refs/tags/ prefix.
Additional claims restrict the scope further. Enter a GitHub OIDC token claim name and its accepted values, separated by commas. Every claim must match; any listed value for that claim is accepted. Values match exactly, without wildcards.
For example, add event_name with push, workflow_dispatch to restrict triggers, or job_workflow_ref with a reusable workflow’s exact ref. You can require a GitHub Environment alongside a branch by adding an environment claim.
Preview environments
Preview acceptspull_request and non-PR workflows, subject to the saved scope and additional claims.
Use Any branch or tag or a matching Environment scope for PR workflows. GitHub’s PR ref is typically refs/pull/NUMBER/merge, so it does not match a Branch scope such as main.
From a pull_request workflow, deploy to a Preview branch using:
id-token: write:
pull_request_target and other PR event types such as pull_request_review are not supported for Preview. Staging and Production reject pull_request* events.
GitHub Actions workflow
This example assumes a pnpm project with a lockfile and apackageManager field in package.json. Set project in trigger.config.ts (or TRIGGER_PROJECT_REF) to the project where you configured trust.
.github/workflows/trigger-deploy.yml
--env staging. For Preview, use --env preview --branch YOUR_PREVIEW_BRANCH.
Open Deployments > Deploys in the target environment and confirm the new deployment succeeded.
--auth-method oidc ignores stored credentials and TRIGGER_ACCESS_TOKEN. Without that flag, an explicit TRIGGER_ACCESS_TOKEN takes precedence over GitHub OIDC, which takes precedence over a saved login.
Promote a deployment
To promote a version deployed with--skip-promotion, run:
--env staging or --env preview --branch BRANCH for other environments. Promotion requires the target environment’s trusted-publishing settings, including any GitHub Environment or additional-claim restrictions. It cannot promote a version from a different environment or roll back to an older version.
preview archive and promote use the same automatic OIDC selection and --auth-method oidc override as deploy. preview archive also accepts a parent Preview environment API key through TRIGGER_ACCESS_TOKEN.
Limits and troubleshooting
- Only full build-server builds are supported. Local builds, Depot builds,
--local-bundle,--from-bundle, and--dry-runare not supported. - The CLI receives no Trigger.dev API key or permission to read or sync environment variables. That work happens inside the build server. Authorized build and task code can still access the target environment’s secrets.
- Submissions are not automatically retried. If a response is lost, check the dashboard before deploying again.
- If authorization fails, check the project ref, pinned IDs, saved environment settings, scope, additional claims, and
id-token: writepermission.

