fix: bug using newline separator (#418)
This commit is contained in:
parent
abb8062519
commit
f5a8de7d36
22
.github/workflows/test.yml
vendored
22
.github/workflows/test.yml
vendored
@ -237,6 +237,16 @@ jobs:
|
|||||||
echo '${{ toJSON(steps.changed-files-forward-slash.outputs) }}'
|
echo '${{ toJSON(steps.changed-files-forward-slash.outputs) }}'
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
|
- name: Run changed-files with newline separator
|
||||||
|
id: changed-files-newline
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
separator: "\n"
|
||||||
|
- name: Show output
|
||||||
|
run: |
|
||||||
|
echo '${{ toJSON(steps.changed-files-newline.outputs) }}'
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
- name: Run changed-files with pipe separator
|
- name: Run changed-files with pipe separator
|
||||||
id: changed-files-pipe
|
id: changed-files-pipe
|
||||||
uses: ./
|
uses: ./
|
||||||
@ -257,6 +267,18 @@ jobs:
|
|||||||
echo '${{ toJSON(steps.changed-files-comma.outputs) }}'
|
echo '${{ toJSON(steps.changed-files-comma.outputs) }}'
|
||||||
shell:
|
shell:
|
||||||
bash
|
bash
|
||||||
|
- name: Run changed-files with specific files from a source file using a newline separator
|
||||||
|
id: changed-files-specific-newline-source-file
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
files_from_source_file: |
|
||||||
|
test/changed-files-list.txt
|
||||||
|
separator: "\n"
|
||||||
|
- name: Show output
|
||||||
|
run: |
|
||||||
|
echo '${{ toJSON(steps.changed-files-specific-newline-source-file.outputs) }}'
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
- name: Run changed-files with specific files
|
- name: Run changed-files with specific files
|
||||||
id: changed-files-specific
|
id: changed-files-specific
|
||||||
uses: ./
|
uses: ./
|
||||||
|
@ -285,6 +285,7 @@ Support this project with a :star:
|
|||||||
|
|
||||||
> NOTE: :warning:
|
> NOTE: :warning:
|
||||||
>
|
>
|
||||||
|
> * Using characters like `\n`, `%` and `\r` as separators would be [URL encoded](https://www.w3schools.com/tags/ref_urlencode.asp)
|
||||||
> * Spaces in file names can introduce bugs when using bash loops. See: [#216](https://github.com/tj-actions/changed-files/issues/216)
|
> * Spaces in file names can introduce bugs when using bash loops. See: [#216](https://github.com/tj-actions/changed-files/issues/216)
|
||||||
> * However, this action will handle spaces in file names, with a recommendation of using a separator to prevent hidden issues.
|
> * However, this action will handle spaces in file names, with a recommendation of using a separator to prevent hidden issues.
|
||||||
> 
|
> 
|
||||||
|
@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
|
INPUT_SEPARATOR="${INPUT_SEPARATOR//'%'/'%25'}"
|
||||||
|
INPUT_SEPARATOR="${INPUT_SEPARATOR//$'\n'/'%0A'}"
|
||||||
|
INPUT_SEPARATOR="${INPUT_SEPARATOR//$'\r'/'%0D'}"
|
||||||
|
|
||||||
function get_diff() {
|
function get_diff() {
|
||||||
base="$1"
|
base="$1"
|
||||||
sha="$2"
|
sha="$2"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user