From 8587b5271c8494db746b5e1dc7b7131e621eab2c Mon Sep 17 00:00:00 2001 From: Bengt Brodersen Date: Fri, 4 Oct 2024 13:36:28 +0200 Subject: [PATCH] feat: add job_name to github context --- src/Runner.Worker/ExecutionContext.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Runner.Worker/ExecutionContext.cs b/src/Runner.Worker/ExecutionContext.cs index f34a9c54a28..c846ae1bad9 100644 --- a/src/Runner.Worker/ExecutionContext.cs +++ b/src/Runner.Worker/ExecutionContext.cs @@ -871,11 +871,13 @@ public void InitializeJob(Pipelines.AgentJobRequestMessage message, Cancellation var base64EncodedToken = Convert.ToBase64String(Encoding.UTF8.GetBytes($"x-access-token:{githubAccessToken}")); HostContext.SecretMasker.AddValue(base64EncodedToken); var githubJob = Global.Variables.Get("system.github.job"); + var githubJobName = Global.Variables.Get("system.jobDisplayName") || githubJob; var githubContext = new GitHubContext(); githubContext["token"] = githubAccessToken; if (!string.IsNullOrEmpty(githubJob)) { githubContext["job"] = new StringContextData(githubJob); + githubContext["job_name"] = new StringContextData(githubJobName); } var githubDictionary = ExpressionValues["github"].AssertDictionary("github"); foreach (var pair in githubDictionary)