1
0
Fork 0

Add tests to ensure secrets are escaped

pull/1430/head
Francesco Renzi 2023-05-25 10:59:41 +01:00
parent 37e09c586f
commit 59851786d4
1 changed files with 5 additions and 1 deletions

View File

@ -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', () => {