mirror of
https://github.com/actions/runner.git
synced 2025-12-10 20:36:49 +00:00
Expose job name as $GITHUB_JOB (#366)
This commit is contained in:
@@ -599,8 +599,13 @@ namespace GitHub.Runner.Worker
|
|||||||
var githubAccessToken = new StringContextData(Variables.Get("system.github.token"));
|
var githubAccessToken = new StringContextData(Variables.Get("system.github.token"));
|
||||||
var base64EncodedToken = Convert.ToBase64String(Encoding.UTF8.GetBytes($"x-access-token:{githubAccessToken}"));
|
var base64EncodedToken = Convert.ToBase64String(Encoding.UTF8.GetBytes($"x-access-token:{githubAccessToken}"));
|
||||||
HostContext.SecretMasker.AddValue(base64EncodedToken);
|
HostContext.SecretMasker.AddValue(base64EncodedToken);
|
||||||
|
var githubJob = Variables.Get("system.github.job");
|
||||||
var githubContext = new GitHubContext();
|
var githubContext = new GitHubContext();
|
||||||
githubContext["token"] = githubAccessToken;
|
githubContext["token"] = githubAccessToken;
|
||||||
|
if (!string.IsNullOrEmpty(githubJob))
|
||||||
|
{
|
||||||
|
githubContext["job"] = new StringContextData(githubJob);
|
||||||
|
}
|
||||||
var githubDictionary = ExpressionValues["github"].AssertDictionary("github");
|
var githubDictionary = ExpressionValues["github"].AssertDictionary("github");
|
||||||
foreach (var pair in githubDictionary)
|
foreach (var pair in githubDictionary)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ namespace GitHub.Runner.Worker
|
|||||||
"event_name",
|
"event_name",
|
||||||
"event_path",
|
"event_path",
|
||||||
"head_ref",
|
"head_ref",
|
||||||
|
"job",
|
||||||
"ref",
|
"ref",
|
||||||
"repository",
|
"repository",
|
||||||
"run_id",
|
"run_id",
|
||||||
|
|||||||
Reference in New Issue
Block a user