From f972c68e97c603bf125f981a617e8812b73d975a Mon Sep 17 00:00:00 2001 From: i4k Date: Fri, 20 Dec 2024 09:49:14 +0000 Subject: [PATCH] chore: sync actor id for github and gitlab. Signed-off-by: i4k --- cloud/types.go | 2 ++ cmd/terramate/cli/cloud.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/cloud/types.go b/cloud/types.go index 59fdea3da..a439178f7 100644 --- a/cloud/types.go +++ b/cloud/types.go @@ -228,6 +228,7 @@ type ( GithubCommitCommitterGitDate *time.Time `json:"github_commit_committer_git_date,omitempty"` GithubActionsDeploymentBranch string `json:"github_actions_deployment_branch,omitempty"` + GithubActionsDeploymentActorID string `json:"github_actions_deployment_actor_id,omitempty"` GithubActionsDeploymentActor string `json:"github_actions_deployment_actor,omitempty"` GithubActionsDeploymentTriggeredBy string `json:"github_actions_triggered_by,omitempty"` GithubActionsRunID string `json:"github_actions_run_id,omitempty"` @@ -267,6 +268,7 @@ type ( GitlabCICDJobName string `json:"gitlab_cicd_job_name,omitempty"` // CI_JOB_NAME GitlabCICDJobStartedAt string `json:"gitlab_cicd_job_started_at,omitempty"` // CI_JOB_STARTED_AT GitlabCICDUserEmail string `json:"gitlab_cicd_user_email,omitempty"` // GITLAB_USER_EMAIL + GitlabCICDUserID string `json:"gitlab_cicd_user_id,omitempty"` // GITLAB_USER_ID GitlabCICDUserName string `json:"gitlab_cicd_user_name,omitempty"` // GITLAB_USER_NAME GitlabCICDUserLogin string `json:"gitlab_cicd_user_login,omitempty"` // GITLAB_USER_LOGIN GitlabCICDCommitBranch string `json:"gitlab_cicd_commit_branch,omitempty"` // CI_COMMIT_BRANCH diff --git a/cmd/terramate/cli/cloud.go b/cmd/terramate/cli/cloud.go index 0a45942fa..a4f89e8ab 100644 --- a/cmd/terramate/cli/cloud.go +++ b/cmd/terramate/cli/cloud.go @@ -985,6 +985,7 @@ func (c *cli) setGitlabCIMetadata(md *cloud.DeploymentMetadata) { md.GitlabCICDJobStartedAt = os.Getenv("CI_JOB_STARTED_AT") md.GitlabCICDUserEmail = os.Getenv("GITLAB_USER_EMAIL") md.GitlabCICDUserName = os.Getenv("GITLAB_USER_NAME") + md.GitlabCICDUserID = os.Getenv("GITLAB_USER_ID") md.GitlabCICDUserLogin = os.Getenv("GITLAB_USER_LOGIN") md.GitlabCICDCommitBranch = os.Getenv("CI_COMMIT_BRANCH") md.GitlabCICDBranch = md.GitlabCICDCommitBranch @@ -1300,6 +1301,7 @@ func setDefaultGitMetadata(md *cloud.DeploymentMetadata, commit *git.CommitMetad } func setGithubActionsMetadata(md *cloud.DeploymentMetadata) { + md.GithubActionsDeploymentActorID = os.Getenv("GITHUB_ACTOR_ID") md.GithubActionsDeploymentActor = os.Getenv("GITHUB_ACTOR") md.GithubActionsDeploymentTriggeredBy = os.Getenv("GITHUB_TRIGGERING_ACTOR") md.GithubActionsDeploymentBranch = os.Getenv("GITHUB_REF_NAME")