mirror of
https://github.com/actions/runner.git
synced 2026-01-11 04:50:50 +08:00
16 lines
564 B
C#
16 lines
564 B
C#
using System;
|
|
using GitHub.Runner.Common;
|
|
|
|
namespace GitHub.Runner.Worker
|
|
{
|
|
public class FeatureManager
|
|
{
|
|
public static bool IsContainerHooksEnabled(Variables variables)
|
|
{
|
|
var isContainerHookFeatureFlagSet = variables?.GetBoolean(Constants.Runner.Features.AllowRunnerContainerHooks) ?? false;
|
|
var isContainerHooksPathSet = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable(Constants.Hooks.ContainerHooksPath));
|
|
return isContainerHookFeatureFlagSet && isContainerHooksPathSet;
|
|
}
|
|
}
|
|
}
|