fix: update safe output regex and the docs (#1805)

Co-authored-by: jackton1 <jackton1@users.noreply.github.com>
Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: Tonye Jack <jtonye@ymail.com>
This commit is contained in:
tj-actions[bot]
2023-12-23 03:56:31 -07:00
committed by GitHub
parent 0102c07446
commit ff2f6e6b91
4 changed files with 44 additions and 16 deletions

View File

@@ -1355,7 +1355,10 @@ export const setOutput = async ({
// if safeOutput is true, escape special characters for bash shell
if (safeOutput) {
cleanedValue = cleanedValue.replace(/[$()`|&;]/g, '\\$&')
cleanedValue = cleanedValue.replace(
/[^\x20-\x7E]|[:*?"<>|;`$()&!]/g,
'\\$&'
)
}
core.setOutput(key, cleanedValue)