From 9477825a90bf6bcaf38155087503aff9a27b159c Mon Sep 17 00:00:00 2001 From: Bryan Kneis Date: Tue, 7 Jan 2025 16:02:15 +0000 Subject: [PATCH] Support COMPOSE_PROJECT_NAME (#1524) --- pkg/compose/helper.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/compose/helper.go b/pkg/compose/helper.go index 6ebc2047c..8f97bdcce 100644 --- a/pkg/compose/helper.go +++ b/pkg/compose/helper.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "io" + "os" "os/exec" "regexp" "strings" @@ -190,6 +191,10 @@ func (h *ComposeHelper) FindProjectFiles(ctx context.Context, projectName string } func (h *ComposeHelper) GetProjectName(runnerID string) string { + // Check for project name override - https://docs.docker.com/compose/how-tos/project-name/ + if projectNameOverride := os.Getenv("COMPOSE_PROJECT_NAME"); projectNameOverride != "" { + return projectNameOverride + } return h.toProjectName(runnerID) }