Skip to content

Commit ff2f6e6

Browse files
tj-actions-botjackton1actions-user
authored
fix: update safe output regex and the docs (#1805)
Co-authored-by: jackton1 <[email protected]> Co-authored-by: GitHub Action <[email protected]> Co-authored-by: Tonye Jack <[email protected]>
1 parent 0102c07 commit ff2f6e6

File tree

4 files changed

+44
-16
lines changed

4 files changed

+44
-16
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,12 @@ Support this project with a :star:
572572
# Default: "\n"
573573
recover_files_separator: ''
574574

575+
# Apply sanitization to output filenames before being set as
576+
# output.
577+
# Type: boolean
578+
# Default: "true"
579+
safe_output: ''
580+
575581
# Split character for output strings.
576582
# Type: string
577583
# Default: " "

dist/index.js

+33-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utils.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1355,7 +1355,10 @@ export const setOutput = async ({
13551355

13561356
// if safeOutput is true, escape special characters for bash shell
13571357
if (safeOutput) {
1358-
cleanedValue = cleanedValue.replace(/[$()`|&;]/g, '\\$&')
1358+
cleanedValue = cleanedValue.replace(
1359+
/[^\x20-\x7E]|[:*?"<>|;`$()&!]/g,
1360+
'\\$&'
1361+
)
13591362
}
13601363

13611364
core.setOutput(key, cleanedValue)

0 commit comments

Comments
 (0)