-
Notifications
You must be signed in to change notification settings - Fork 989
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
Notify on unsecure commands #731
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left you some comments. I'll take another look once they're addressed 👍
Should have responded to all your feedback @juliobbv |
} | ||
|
||
var allowUnsecureCommands = false; | ||
bool.TryParse(Environment.GetEnvironmentVariable(Constants.Variables.Actions.AllowUnsupportedCommands), out allowUnsecureCommands); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ericsciple this pulls from the .env
file in the layout folder of the runner. Users won't be able to set it in their workflow job env.
@@ -282,6 +309,33 @@ public sealed class AddPathCommandExtension : RunnerService, IActionCommandExten | |||
|
|||
public void ProcessCommand(IExecutionContext context, string line, ActionCommand command, ContainerInfo container) | |||
{ | |||
var serverUrl = context.GetGitHubContext("server_url"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var configurationStore = HostContext.GetService<IConfigurationStore>();
var isHostedServer = configurationStore.GetSettings().IsHostedServer;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^ better for consistency with the other places in the runner
{ | ||
throw new Exception(String.Format(Constants.Runner.UnsupportedCommandMessageDisabled, this.Command)); | ||
} | ||
else if(!allowUnsecureCommands) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kind of weird that allow
is false, and then we warn but allow anyway
wondering whether the default value of allow
should be based on whether is hosted server. And then if the env var is specified, respect it.
* notify on unsecure commands
* notify on unsecure commands
The purpose of this PR is to add telemetry and notify PR's when they are using the unsecure commands in the runner. Eventually, we will need to disable these commands, but getting people to migrate off of them is the first step. This pr will create annotations on runs where these commands are used. For example:
Testing