Skip to content

Commit 680324e

Browse files
committed
Detect other CI envs besides gh actions
1 parent 6c658d4 commit 680324e

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

packages/cli-v3/src/commands/deploy.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,9 +896,32 @@ async function initializeOrAttachDeployment(
896896
}
897897

898898
function getTriggeredVia(): DeploymentTriggeredVia {
899+
// Check specific CI providers first (most specific to least specific)
899900
if (isGitHubActions()) {
900901
return "cli:github_actions";
901902
}
903+
if (process.env.GITLAB_CI === "true") {
904+
return "cli:gitlab_ci";
905+
}
906+
if (process.env.CIRCLECI === "true") {
907+
return "cli:circleci";
908+
}
909+
if (process.env.JENKINS_URL) {
910+
return "cli:jenkins";
911+
}
912+
if (process.env.TF_BUILD === "True") {
913+
return "cli:azure_pipelines";
914+
}
915+
if (process.env.BITBUCKET_BUILD_NUMBER) {
916+
return "cli:bitbucket_pipelines";
917+
}
918+
if (process.env.TRAVIS === "true") {
919+
return "cli:travis_ci";
920+
}
921+
if (process.env.BUILDKITE === "true") {
922+
return "cli:buildkite";
923+
}
924+
// Fallback for other/unknown CI environments
902925
if (isCI) {
903926
return "cli:ci_other";
904927
}

packages/core/src/v3/schemas/api.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,20 @@ export type ExternalBuildData = z.infer<typeof ExternalBuildData>;
403403
const anyString = z.custom<string & {}>((v) => typeof v === "string");
404404

405405
export const DeploymentTriggeredVia = z
406-
.enum(["cli:manual", "cli:ci_other", "cli:github_actions", "git_integration:github", "dashboard"])
406+
.enum([
407+
"cli:manual",
408+
"cli:ci_other",
409+
"cli:github_actions",
410+
"cli:gitlab_ci",
411+
"cli:circleci",
412+
"cli:jenkins",
413+
"cli:azure_pipelines",
414+
"cli:bitbucket_pipelines",
415+
"cli:travis_ci",
416+
"cli:buildkite",
417+
"git_integration:github",
418+
"dashboard",
419+
])
407420
.or(anyString);
408421

409422
export type DeploymentTriggeredVia = z.infer<typeof DeploymentTriggeredVia>;

0 commit comments

Comments
 (0)