mirror of
https://github.com/actions/runner.git
synced 2025-12-12 14:17:46 +00:00
Null out refName
This commit is contained in:
@@ -270,6 +270,12 @@ namespace GitHub.Runner.Worker
|
|||||||
{
|
{
|
||||||
Trace.Entering();
|
Trace.Entering();
|
||||||
|
|
||||||
|
// TODO: Null out old, non-json refNames only if a FF is set.
|
||||||
|
if (refName != null && !refName.StartsWith("{"))
|
||||||
|
{
|
||||||
|
refName = null;
|
||||||
|
}
|
||||||
|
|
||||||
var child = new ExecutionContext();
|
var child = new ExecutionContext();
|
||||||
child.Initialize(HostContext);
|
child.Initialize(HostContext);
|
||||||
child.ScopeName = scopeName;
|
child.ScopeName = scopeName;
|
||||||
@@ -873,7 +879,9 @@ namespace GitHub.Runner.Worker
|
|||||||
}
|
}
|
||||||
|
|
||||||
var newGuid = Guid.NewGuid();
|
var newGuid = Guid.NewGuid();
|
||||||
return CreateChild(newGuid, displayName, refName ?? newGuid.ToString("N"), null, null, intraActionState, _childTimelineRecordOrder - Root.PostJobSteps.Count);
|
|
||||||
|
// TODO: Check feature flag here, conditionally set refName to newGuid.ToString("N").
|
||||||
|
return CreateChild(newGuid, displayName, refName, null, null, intraActionState, _childTimelineRecordOrder - Root.PostJobSteps.Count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ namespace GitHub.Runner.Worker
|
|||||||
public static class IStepExtensions
|
public static class IStepExtensions
|
||||||
{
|
{
|
||||||
public static string GetRefName(this IStep step, string defaultRefName = null)
|
public static string GetRefName(this IStep step, string defaultRefName = null)
|
||||||
|
{
|
||||||
|
// TODO: Really check a feature flag.
|
||||||
|
if (s_featureFlagEnabled)
|
||||||
{
|
{
|
||||||
if (step is JobExtensionRunner extensionRunner && extensionRunner.RepositoryRef != null)
|
if (step is JobExtensionRunner extensionRunner && extensionRunner.RepositoryRef != null)
|
||||||
{
|
{
|
||||||
@@ -16,7 +19,13 @@ namespace GitHub.Runner.Worker
|
|||||||
return JsonConvert.SerializeObject(actionRunner.Action.Reference);
|
return JsonConvert.SerializeObject(actionRunner.Action.Reference);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RefName should always be valid json or null.
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return defaultRefName;
|
return defaultRefName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static bool s_featureFlagEnabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user