diff --git a/src/Runner.Worker/ExecutionContext.cs b/src/Runner.Worker/ExecutionContext.cs index 22e1226abb8..d390a9e8680 100644 --- a/src/Runner.Worker/ExecutionContext.cs +++ b/src/Runner.Worker/ExecutionContext.cs @@ -599,8 +599,13 @@ public void InitializeJob(Pipelines.AgentJobRequestMessage message, Cancellation var githubAccessToken = new StringContextData(Variables.Get("system.github.token")); var base64EncodedToken = Convert.ToBase64String(Encoding.UTF8.GetBytes($"x-access-token:{githubAccessToken}")); HostContext.SecretMasker.AddValue(base64EncodedToken); + var githubJob = Variables.Get("system.github.job"); var githubContext = new GitHubContext(); githubContext["token"] = githubAccessToken; + if (!string.IsNullOrEmpty(githubJob)) + { + githubContext["job"] = new StringContextData(githubJob); + } var githubDictionary = ExpressionValues["github"].AssertDictionary("github"); foreach (var pair in githubDictionary) { diff --git a/src/Runner.Worker/GitHubContext.cs b/src/Runner.Worker/GitHubContext.cs index 0316fad854b..454f5e21111 100644 --- a/src/Runner.Worker/GitHubContext.cs +++ b/src/Runner.Worker/GitHubContext.cs @@ -14,6 +14,7 @@ public sealed class GitHubContext : DictionaryContextData, IEnvironmentContextDa "event_name", "event_path", "head_ref", + "job", "ref", "repository", "run_id",