From 64b7f0b0433f7b6c8c0c07b4a63f93279ac6f042 Mon Sep 17 00:00:00 2001 From: Matt Kingston Date: Thu, 13 Mar 2025 14:31:43 +0100 Subject: [PATCH] Add GITHUB_TRIGGERING_ACTOR to GH context --- actions.go | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/actions.go b/actions.go index f7b32a8..2db421c 100644 --- a/actions.go +++ b/actions.go @@ -489,15 +489,16 @@ type GitHubContext struct { // but to use the Repo method instead. RepositoryOwner string - RetentionDays int64 - RunAttempt int64 - RunID int64 - RunNumber int64 - ServerURL string - SHA string - StepSummary string - Workflow string - Workspace string + RetentionDays int64 + RunAttempt int64 + RunID int64 + RunNumber int64 + ServerURL string + SHA string + StepSummary string + TriggeringActor string + Workflow string + Workspace string // Event is populated by parsing the file at EventPath, if it exists. Event map[string]any @@ -659,6 +660,9 @@ func (c *Action) Context() (*GitHubContext, error) { if v := c.getenv("GITHUB_STEP_SUMMARY"); v != "" { githubContext.StepSummary = v } + if v := c.getenv("GITHUB_TRIGGERING_ACTOR"); v != "" { + githubContext.TriggeringActor = v + } if v := c.getenv("GITHUB_WORKFLOW"); v != "" { githubContext.Workflow = v }