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:
parent
0102c07446
commit
ff2f6e6b91
4 changed files with 10 additions and 1 deletions
|
@ -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
BIN
dist/index.js
generated
vendored
Binary file not shown.
BIN
dist/index.js.map
generated
vendored
BIN
dist/index.js.map
generated
vendored
Binary file not shown.
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue