File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -22,12 +22,13 @@ import { logger } from "../utilities/logger.js";
2222import { spinner } from "../utilities/windows.js" ;
2323import { isLinuxServer } from "../utilities/linux.js" ;
2424import { VERSION } from "../version.js" ;
25- import { env } from "std-env" ;
25+ import { env , isCI } from "std-env" ;
2626import { CLOUD_API_URL } from "../consts.js" ;
2727import {
2828 isPersonalAccessToken ,
2929 NotPersonalAccessTokenError ,
3030} from "../utilities/isPersonalAccessToken.js" ;
31+ import { links } from "@trigger.dev/core/v3" ;
3132
3233export const LoginCommandOptions = CommonCommandOptions . extend ( {
3334 apiUrl : z . string ( ) ,
@@ -210,6 +211,24 @@ export async function login(options?: LoginOptions): Promise<LoginResult> {
210211 }
211212 }
212213
214+ if ( isCI ) {
215+ const apiUrl =
216+ env . TRIGGER_API_URL ?? authConfig ?. apiUrl ?? opts . defaultApiUrl ?? CLOUD_API_URL ;
217+
218+ const isSelfHosted = apiUrl !== CLOUD_API_URL ;
219+
220+ // This is fine, as the api URL will generally be the same as the dashboard URL for self-hosted instances
221+ const dashboardUrl = isSelfHosted ? apiUrl : "https://cloud.trigger.dev" ;
222+
223+ throw new Error (
224+ `Authentication required in CI environment. Please set the TRIGGER_ACCESS_TOKEN environment variable with a Personal Access Token.
225+
226+ - You can generate one here: ${ dashboardUrl } /account/tokens
227+
228+ - For more information, see: ${ links . docs . gitHubActions . personalAccessToken } `
229+ ) ;
230+ }
231+
213232 if ( opts . embedded ) {
214233 log . step ( "You must login to continue." ) ;
215234 }
Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ export const links = {
2020 "https://trigger.dev/docs/queue-concurrency#waiting-for-a-subtask-on-the-same-queue" ,
2121 deadlock : "https://trigger.dev/docs/queue-concurrency#deadlock" ,
2222 } ,
23+ gitHubActions : {
24+ personalAccessToken :
25+ "https://trigger.dev/docs/github-actions#creating-a-personal-access-token" ,
26+ } ,
2327 } ,
2428 site : {
2529 home : "https://trigger.dev" ,
You can’t perform that action at this time.
0 commit comments