mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-01-04 05:12:55 +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', () => {
|
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…
x
Reference in New Issue
Block a user