Use Global.Variables instead of JobContext and include action path/ref in the message. (#2214)

* Use Global.Variables instead of JobContext and include action path/ref in the message.

* encoding

* .
This commit is contained in:
Tingluo Huang
2022-11-02 09:40:19 -04:00
committed by GitHub
parent d301c06a7e
commit 4adaf9c1e6
4 changed files with 33 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -258,9 +258,9 @@ namespace GitHub.Runner.Worker
}
}
if (jobContext.JobContext.ContainsKey("Node12ActionsWarnings"))
if (jobContext.Global.Variables.TryGetValue("Node12ActionsWarnings", out var node12Warnings))
{
var actions = string.Join(", ", jobContext.JobContext["Node12ActionsWarnings"].AssertArray("Node12ActionsWarnings").Select(action => action.ToString()));
var actions = string.Join(", ", StringUtil.ConvertFromJson<HashSet<string>>(node12Warnings));
jobContext.Warning(string.Format(Constants.Runner.Node12DetectedAfterEndOfLife, actions));
}