Skip to content

Commit 7ee436b

Browse files
ericallamTrigger.dev RepoOps
authored andcommitted
feat(webapp): give runs a TRIGGER_DASHBOARD_URL environment variable
Runs now get a `TRIGGER_DASHBOARD_URL` environment variable set to the dashboard's address (`APP_ORIGIN`, without a trailing slash), in dev and deployed environments. A `TRIGGER_DASHBOARD_URL` set on the project overrides it. A task can link to its own run on any instance: ```ts const runUrl = `${process.env.TRIGGER_DASHBOARD_URL}/runs/${ctx.run.id}`; ``` `/runs/<runId>` checks that the viewer belongs to the run's organization, then redirects to the full run page. Mono-RevId: 7541a5f02d5c69f77ab422974c9944eac97d722b
1 parent ee54065 commit 7ee436b

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: improvement
4+
---
5+
6+
Runs now get a `TRIGGER_DASHBOARD_URL` environment variable with the dashboard's address, so a task can link to its run (`${TRIGGER_DASHBOARD_URL}/runs/${ctx.run.id}`) on any Trigger.dev instance. A `TRIGGER_DASHBOARD_URL` you set on the project still wins.

‎apps/webapp/app/v3/environmentVariables/environmentVariablesRepository.server.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,10 @@ async function resolveOverridableTriggerVariables(
10301030
key: "TRIGGER_REALTIME_STREAM_VERSION",
10311031
value: env.REALTIME_STREAM_VERSION,
10321032
},
1033+
{
1034+
key: "TRIGGER_DASHBOARD_URL",
1035+
value: env.APP_ORIGIN.replace(/\/$/, ""),
1036+
},
10331037
];
10341038

10351039
return result;

0 commit comments

Comments
 (0)