mirror of https://github.com/actions/toolkit
Add tests to ensure secrets are escaped
parent
37e09c586f
commit
59851786d4
|
@ -161,7 +161,11 @@ describe('@actions/core', () => {
|
||||||
|
|
||||||
it('setSecret produces the correct command', () => {
|
it('setSecret produces the correct command', () => {
|
||||||
core.setSecret('secret val')
|
core.setSecret('secret val')
|
||||||
assertWriteCalls([`::add-mask::secret val${os.EOL}`])
|
core.setSecret('multi\nline\r\nsecret')
|
||||||
|
assertWriteCalls([
|
||||||
|
`::add-mask::secret val${os.EOL}`,
|
||||||
|
`::add-mask::multi%0Aline%0D%0Asecret${os.EOL}`
|
||||||
|
])
|
||||||
})
|
})
|
||||||
|
|
||||||
it('prependPath produces the correct commands and sets the env', () => {
|
it('prependPath produces the correct commands and sets the env', () => {
|
||||||
|
|
Loading…
Reference in New Issue