Skip to content

Commit

Permalink
Add tests to ensure secrets are escaped
Browse files Browse the repository at this point in the history
  • Loading branch information
rentziass committed May 25, 2023
1 parent 37e09c5 commit 5985178
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/core/__tests__/core.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit 5985178

Please sign in to comment.