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
Adds escape sequences for '\r', '\n' & '%' characters in Action#SetOutput() #5
Adds escape sequences for '\r', '\n' & '%' characters in Action#SetOutput() #5
Conversation
@@ -114,6 +114,9 @@ func (c *Action) SetEnv(k, v string) { | |||
|
|||
// SetOutput sets an output parameter. | |||
func (c *Action) SetOutput(k, v string) { | |||
v = strings.ReplaceAll(v, "%", "%25") |
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.
should we just URL-encode the whole thing?
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.
or perhaps the list is larger? https://github.com/actions/toolkit/blob/d69e699ab956dac3d3d25bb3c3feda23c1cb3a6c/packages/core/src/command.ts#L92-L106
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.
I agree that there are two more symbols to add but URL encoding the whole thing will escape a lot more characters I think? I suggest copying the JS/TS version and leaving its link for future reference in case its updated and someone faces the problem?
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.
SGTM - let me know when you want re-review 😄
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.
I just need a minute.
Thanks! |
@sethvargo Sorry for the incovenience but I just put this to test and it feels like GitHub is not unescaping colon See this issue - https://github.com/ashutoshgngwr/test/issues/1 Please let me know your inputs on this. |
hmmmmm. okay weird. if you submit a pr to remove those, ill merge it 😄 |
This pull request has been automatically locked since there has not |
See https://github.community/t/set-output-truncates-multiline-strings/16852
Resolves #4