mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2025-11-18 14:51:07 +08:00
Add tests to ensure secrets are escaped
This commit is contained in:
parent
37e09c586f
commit
59851786d4
@ -161,7 +161,11 @@ describe('@actions/core', () => {
|
||||
|
||||
it('setSecret produces the correct command', () => {
|
||||
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', () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user