Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull upstream #2178

Merged
merged 22 commits into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
01fd044
Escaping key and quoting it to avoid key based command injection (#2062)
nikola-jokic Aug 23, 2022
cba19c4
Release notes for 2.296.0 (#2078)
AvaStancu Aug 23, 2022
5989479
Validate lines and columns for Annotations (#2082)
konradpabjan Aug 24, 2022
95459de
docker: escape key-value pair as -e KEY and VALUE being environment v…
nikola-jokic Aug 31, 2022
5e0c2ef
2.296.1 Release (#2092) (#2099)
fhammerl Sep 2, 2022
7578675
fix ACTIONS_RUNNER_CONTAINER_HOOKS name in ADR (#2098)
nikola-jokic Sep 6, 2022
ed191b7
Port hotfix to main branch (#2108)
thboop Sep 9, 2022
6e6410d
fix for issue #2009 - composite summary file (#2077)
ruvceskistefan Sep 12, 2022
32845a5
Bump @actions/core from 1.2.6 to 1.9.1 in /src/Misc/expressionFunc/ha…
rentziass Sep 15, 2022
6cdd272
Remove unused imports (#2124)
JoannaaKL Sep 15, 2022
3a1c897
Remove unused imports (#2126)
JoannaaKL Sep 15, 2022
0678e8d
Add Release branches to pull request spec (#2134)
thboop Sep 19, 2022
15cbadb
Add file commands for save-state and set-output (#2118)
rentziass Sep 26, 2022
ae2f4a6
POC: Windows arm64 runner build (#2022)
thboop Sep 26, 2022
bc67f99
Add link to blog post to node 12 warn (#2156)
takost Sep 26, 2022
01ff38f
2.297.0 release notes (#2155)
thboop Sep 26, 2022
dca4f67
Adding a new vars context for non-secret variables (#2096)
tauhid621 Sep 30, 2022
9492691
Avastancu/joannaakl/service container error log (#2110)
JoannaaKL Oct 3, 2022
920fba9
Add warning for users using deprecated commands (#2164)
rentziass Oct 4, 2022
4935be5
Prepare release notes for v2.298.0 (#2169)
rentziass Oct 4, 2022
1379ed2
Fix incorrect template vars to show SHA for WIN-ARM64 (#2171)
fhammerl Oct 4, 2022
86d0ee8
Backport 2.298.1 (#2175)
fhammerl Oct 4, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add warning for users using deprecated commands (#2164)
  • Loading branch information
rentziass authored Oct 4, 2022
commit 920fba93dc72749f0f2e5445f761f321f9c97429
1 change: 1 addition & 0 deletions src/Runner.Common/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ public static class Features
public static readonly string WorkerCrash = "WORKER_CRASH";
public static readonly string LowDiskSpace = "LOW_DISK_SPACE";
public static readonly string UnsupportedCommand = "UNSUPPORTED_COMMAND";
public static readonly string UnsupportedCommandMessage = "The `{0}` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/";
public static readonly string UnsupportedCommandMessageDisabled = "The `{0}` command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable to `true`. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/";
public static readonly string UnsupportedStopCommandTokenDisabled = "You cannot use a endToken that is an empty string, the string 'pause-logging', or another workflow command. For more information see: https://docs.github.com/actions/learn-github-actions/workflow-commands-for-github-actions#example-stopping-and-starting-workflow-commands or opt into insecure command execution by setting the `ACTIONS_ALLOW_UNSECURE_STOPCOMMAND_TOKENS` environment variable to `true`.";
public static readonly string UnsupportedSummarySize = "$GITHUB_STEP_SUMMARY upload aborted, supports content up to a size of {0}k, got {1}k. For more information see: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-markdown-summary";
Expand Down
24 changes: 23 additions & 1 deletion src/Runner.Worker/ActionCommandManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,17 @@ public sealed class SetOutputCommandExtension : RunnerService, IActionCommandExt

public void ProcessCommand(IExecutionContext context, string line, ActionCommand command, ContainerInfo container)
{
if (context.Global.Variables.GetBoolean("DistributedTask.DeprecateStepOutputCommands") ?? false)
{
var issue = new Issue()
{
Type = IssueType.Warning,
Message = String.Format(Constants.Runner.UnsupportedCommandMessage, this.Command)
};
issue.Data[Constants.Runner.InternalTelemetryIssueDataKey] = Constants.Runner.UnsupportedCommand;
context.AddIssue(issue);
}

if (!command.Properties.TryGetValue(SetOutputCommandProperties.Name, out string outputName) || string.IsNullOrEmpty(outputName))
{
throw new Exception("Required field 'name' is missing in ##[set-output] command.");
Expand All @@ -331,6 +342,17 @@ public sealed class SaveStateCommandExtension : RunnerService, IActionCommandExt

public void ProcessCommand(IExecutionContext context, string line, ActionCommand command, ContainerInfo container)
{
if (context.Global.Variables.GetBoolean("DistributedTask.DeprecateStepOutputCommands") ?? false)
{
var issue = new Issue()
{
Type = IssueType.Warning,
Message = String.Format(Constants.Runner.UnsupportedCommandMessage, this.Command)
};
issue.Data[Constants.Runner.InternalTelemetryIssueDataKey] = Constants.Runner.UnsupportedCommand;
context.AddIssue(issue);
}

if (!command.Properties.TryGetValue(SaveStateCommandProperties.Name, out string stateName) || string.IsNullOrEmpty(stateName))
{
throw new Exception("Required field 'name' is missing in ##[save-state] command.");
Expand Down Expand Up @@ -586,7 +608,7 @@ public abstract class IssueCommandExtension : RunnerService, IActionCommandExten
public void ProcessCommand(IExecutionContext context, string inputLine, ActionCommand command, ContainerInfo container)
{
ValidateLinesAndColumns(command, context);

command.Properties.TryGetValue(IssueCommandProperties.File, out string file);
command.Properties.TryGetValue(IssueCommandProperties.Line, out string line);
command.Properties.TryGetValue(IssueCommandProperties.Column, out string column);
Expand Down