diff --git a/src/Runner.Worker/ExecutionContext.cs b/src/Runner.Worker/ExecutionContext.cs index 7bb7e7efc..eb9232104 100644 --- a/src/Runner.Worker/ExecutionContext.cs +++ b/src/Runner.Worker/ExecutionContext.cs @@ -735,12 +735,17 @@ namespace GitHub.Runner.Worker var base64EncodedToken = Convert.ToBase64String(Encoding.UTF8.GetBytes($"x-access-token:{githubAccessToken}")); HostContext.SecretMasker.AddValue(base64EncodedToken); var githubJob = Global.Variables.Get("system.github.job"); + var githubJobId = Global.Variables.Get("system.github.jobId"); var githubContext = new GitHubContext(); githubContext["token"] = githubAccessToken; if (!string.IsNullOrEmpty(githubJob)) { githubContext["job"] = new StringContextData(githubJob); } + if (!string.IsNullOrEmpty(githubJobId)) + { + githubContext["job_id"] = new StringContextData(githubJobId); + } 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 cdefd45b4..5353935e2 100644 --- a/src/Runner.Worker/GitHubContext.cs +++ b/src/Runner.Worker/GitHubContext.cs @@ -21,6 +21,7 @@ namespace GitHub.Runner.Worker "graphql_url", "head_ref", "job", + "job_id", "path", "ref_name", "ref_protected",