Skip to content

Commit

Permalink
dynamic holodeck ci instance name
Browse files Browse the repository at this point in the history
Signed-off-by: shiva kumar <[email protected]>
  • Loading branch information
shivakunv committed Dec 14, 2024
1 parent a81e89c commit 7a83c02
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cmd/action/ci/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,15 @@ func setCfgName(cfg *v1alpha1.Environment) {
}
// uid is unique for each run
uid := generateUID()

actor := os.Getenv("GITHUB_ACTOR")
BRANCH_NAME := os.Getenv("GITHUB_REF_NAME")
REPO_NAME := os.Getenv("GITHUB_REPOSITORY")
parts := strings.Split(REPO_NAME, "/")
branchName := os.Getenv("GITHUB_REF_NAME")
repo_name := os.Getenv("GITHUB_REPOSITORY")
parts := strings.Split(repo_name, "/")
repoName := parts[len(parts)-1]

if cfg.Name != "" {
cfg.Name = fmt.Sprintf("ci%s-%s-%s-NAME-%s-ACTOR-%s-REPONAME-%s", attempt, sha, uid, cfg.Name, actor, repoName)
cfg.Name = fmt.Sprintf("ci%s-%s-%s-NAME-%s-ACTOR-%s-branch_Name-%s-REPONAME-%s", attempt, sha, uid, cfg.Name, actor, branchName, repoName)
} else {
actor := os.Getenv("GITHUB_ACTOR")
cfg.Name = fmt.Sprintf("ci%s-%s-%s-%s", attempt, sha, uid, actor)
Expand Down

0 comments on commit 7a83c02

Please sign in to comment.