mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
add runner hostname to CI invocation context (#356)
* add runner hostname to CI invocation context * update test
This commit is contained in:
@@ -20,9 +20,9 @@ func (r *githubActionsEnvResolver) Provider() controltowerv1.EndpointCIProvider
|
||||
}
|
||||
|
||||
func (r *githubActionsEnvResolver) RunId() string { return os.Getenv("GITHUB_RUN_ID") }
|
||||
func (r *githubActionsEnvResolver) Repository() string { return os.Getenv("GITHUB_REPOSITORY") }
|
||||
func (r *githubActionsEnvResolver) CommitSha() string { return os.Getenv("GITHUB_SHA") }
|
||||
func (r *githubActionsEnvResolver) Actor() string { return os.Getenv("GITHUB_ACTOR") }
|
||||
func (r *githubActionsEnvResolver) Repository() string { return os.Getenv("GITHUB_REPOSITORY") }
|
||||
func (r *githubActionsEnvResolver) CommitSha() string { return os.Getenv("GITHUB_SHA") }
|
||||
func (r *githubActionsEnvResolver) Actor() string { return os.Getenv("GITHUB_ACTOR") }
|
||||
|
||||
func (r *githubActionsEnvResolver) Branch() string {
|
||||
if headRef := os.Getenv("GITHUB_HEAD_REF"); headRef != "" {
|
||||
@@ -57,6 +57,10 @@ func (r *githubActionsEnvResolver) Metadata() map[string]string {
|
||||
}
|
||||
}
|
||||
|
||||
if hostname, err := os.Hostname(); err == nil && hostname != "" {
|
||||
metadata["hostname"] = hostname
|
||||
}
|
||||
|
||||
if len(metadata) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user