Trusted publishing for GitHub Actions

With trusted publishing, only the GitHub repository, branch or environment you choose can deploy to your Trigger.dev project.

Chris Arderne

Chris Arderne

Software Engineer, Trigger.dev

Image for Trusted publishing for GitHub Actions

Trusted publishing for GitHub Actions is now available on Trigger.dev Cloud and self-hosted instances.

Your workflows can now deploy to Trigger.dev without a Trigger.dev API key stored in your GitHub secrets.

How trusted publishing works

Trusted publishing uses OpenID Connect (OIDC), an open standard for proving who you are with a signed token. GitHub Actions gives your workflow a signed token that says which repository and workflow it is, and Trigger.dev checks it before letting it deploy.

This is a separate feature from OIDC for tasks, which works the other way round. There, Trigger.dev gives your tasks a token so they can access services like Anthropic. Here, GitHub gives your workflow a token so it can deploy to Trigger.dev.

This is safer than a deploy key in your GitHub secrets because only the repository, branch, tag or GitHub Environment you choose can deploy.

Set up trusted publishing

Open Security → Trusted publishing in the dashboard, enter your GitHub organization and repository, then enable each environment you want to deploy to. You can limit it to a branch, a tag or a GitHub Environment (which can have required reviewers), and pin the numeric owner and repository IDs so a renamed or deleted repository can't be taken over.

Then give the workflow id-token: write and deploy with --auth-method oidc:

.github/workflows/trigger-deploy.yml

on:
push:
branches: [main]
permissions:
contents: read
id-token: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
# ...install your dependencies
- run: npx trigger.dev@latest deploy --auth-method oidc --native-build --env prod

The CLI never gets a Trigger.dev API key or access to your environment variables. The whole build runs on our build server.

pull_request workflows can deploy to Preview environments. Staging and Production reject PR events, and pull_request_target isn't supported at all.

You'll need the CLI at v4.8.4 or later. The trusted publishing docs cover the full setup.

Deploy your first agent today

Get set up in minutes, either on your own or with your coding agent.

Get started for free