3
0
Fork 0
mirror of https://github.com/tj-actions/changed-files synced 2024-12-16 09:27:57 +00:00

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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 1 deletions

View file

@ -572,6 +572,12 @@ Support this project with a :star:
# Default: "\n"
recover_files_separator: ''
# Apply sanitization to output filenames before being set as
# output.
# Type: boolean
# Default: "true"
safe_output: ''
# Split character for output strings.
# Type: string
# Default: " "

BIN
dist/index.js generated vendored

Binary file not shown.

BIN
dist/index.js.map generated vendored

Binary file not shown.

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)