diff --git a/src/Runner.Common/Constants.cs b/src/Runner.Common/Constants.cs index 05b939270..9ad29b4ac 100644 --- a/src/Runner.Common/Constants.cs +++ b/src/Runner.Common/Constants.cs @@ -128,7 +128,7 @@ namespace GitHub.Runner.Common public static readonly string Ephemeral = "ephemeral"; public static readonly string Help = "help"; public static readonly string Replace = "replace"; - public static readonly string Once = "once"; // TODO: Remove in 10/2021 + public static readonly string Once = "once"; // Keep this around since customers still relies on it public static readonly string RunAsService = "runasservice"; public static readonly string Unattended = "unattended"; public static readonly string Version = "version"; diff --git a/src/Runner.Listener/CommandSettings.cs b/src/Runner.Listener/CommandSettings.cs index b5e1c1a69..da0d301fb 100644 --- a/src/Runner.Listener/CommandSettings.cs +++ b/src/Runner.Listener/CommandSettings.cs @@ -31,6 +31,7 @@ namespace GitHub.Runner.Listener Constants.Runner.CommandLine.Flags.Commit, Constants.Runner.CommandLine.Flags.Ephemeral, Constants.Runner.CommandLine.Flags.Help, + Constants.Runner.CommandLine.Flags.Once, Constants.Runner.CommandLine.Flags.Replace, Constants.Runner.CommandLine.Flags.RunAsService, Constants.Runner.CommandLine.Flags.Unattended, @@ -68,7 +69,7 @@ namespace GitHub.Runner.Listener public bool Version => TestFlag(Constants.Runner.CommandLine.Flags.Version); public bool Ephemeral => TestFlag(Constants.Runner.CommandLine.Flags.Ephemeral); - // TODO: Remove in 10/2021 + // Keep this around since customers still relies on it public bool RunOnce => TestFlag(Constants.Runner.CommandLine.Flags.Once); // Constructor. diff --git a/src/Runner.Listener/Runner.cs b/src/Runner.Listener/Runner.cs index 8f55cd348..bdeff538d 100644 --- a/src/Runner.Listener/Runner.cs +++ b/src/Runner.Listener/Runner.cs @@ -233,8 +233,14 @@ namespace GitHub.Runner.Listener Trace.Info($"Set runner startup type - {startType}"); HostContext.StartupType = startType; + if (command.RunOnce) + { + _term.WriteLine("Warning: '--once' is going to be deprecated in the future, please consider using '--ephemeral' during runner registration.", ConsoleColor.Yellow); + _term.WriteLine("https://docs.github.com/en/actions/hosting-your-own-runners/autoscaling-with-self-hosted-runners#using-ephemeral-runners-for-autoscaling", ConsoleColor.Yellow); + } + // Run the runner interactively or as service - return await RunAsync(settings, command.RunOnce || settings.Ephemeral); // TODO: Remove RunOnce later. + return await RunAsync(settings, command.RunOnce || settings.Ephemeral); } else {