Skip to content

Commit

Permalink
feat: rename escape-paths to safe-output (#1029)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 committed May 4, 2024
1 parent 3101549 commit be06119
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,17 +158,17 @@ jobs:
- name: Run glob for source-files.txt escape paths
uses: ./
id: glob-source-files-escape-paths
id: glob-source-files-safe-output
with:
files-from-source-file: |
src/__tests__/source-files.txt
src/__tests__/source-files.txt
escape-paths: true
safe-output: true

- name: Show output
run: |
echo "${{ steps.glob-source-files-escape-paths.outputs.paths }}"
cat "${{ steps.glob-source-files-escape-paths.outputs.paths-output-file }}"
echo "${{ steps.glob-source-files-safe-output.outputs.paths }}"
cat "${{ steps.glob-source-files-safe-output.outputs.paths-output-file }}"
- name: Run glob for source-files.txt
uses: ./
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ inputs:
description: 'Separator used for the paths output.'
required: true
default: " "
escape-paths:
safe-output:
description: 'Escape special characters of filenames used in the `paths` output'
required: false
default: "true"
Expand Down
4 changes: 2 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/__tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const defaultEnv = {
'INPUT_FOLLOW-SYMBOLIC-LINKS': 'true',
'INPUT_MATCH-DIRECTORIES': 'true',
'INPUT_MATCH-GITIGNORE-FILES': 'true',
'INPUT_ESCAPE-PATHS': 'false',
'INPUT_SAFE-OUTPUT': 'false',
'INPUT_HEAD-REPO-FORK': 'false',
INPUT_SEPARATOR: ' ',
'INPUT_STRIP-TOP-LEVEL-DIR': 'true',
Expand Down
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export async function run(): Promise<void> {
trimWhitespace: false
})
const diff = core.getInput('diff', {required: false})
const escapePaths = core.getBooleanInput('escape-paths', {required: false})
const safeOutput = core.getBooleanInput('safe-output', {required: false})
const stripTopLevelDir = core.getBooleanInput('strip-top-level-dir', {
required: true
})
Expand Down Expand Up @@ -270,7 +270,7 @@ export async function run(): Promise<void> {
)
}

if (escapePaths) {
if (safeOutput) {
paths = new Set([...paths].map(p => escapeString(p)))
}

Expand Down

0 comments on commit be06119

Please sign in to comment.