fix: bug with outputs when json is set to true (#1531)

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
Tonye Jack
2023-09-04 14:03:32 -06:00
committed by GitHub
parent fd460fa3ba
commit 8d335b7b7d
7 changed files with 362 additions and 150 deletions

View File

@@ -1029,7 +1029,8 @@ jobs:
if: |
(
!contains(steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files, 'test/test rename-1.txt') ||
!contains(steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files, 'test')
!contains(steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files, 'test') ||
steps.changed-files-dir-names-specific-include-files.outputs.any_changed == 'false'
) && runner.os != 'Windows'
run: |
echo "Invalid output: Expected to include (test/test rename-1.txt) and (test) got (${{ steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files }})"
@@ -1040,13 +1041,41 @@ jobs:
if: |
(
!contains(steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files, 'test\\test rename-1.txt') ||
!contains(steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files, 'test')
!contains(steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files, 'test') ||
steps.changed-files-dir-names-specific-include-files.outputs.any_changed == 'false'
) && runner.os == 'Windows'
run: |
echo "Invalid output: Expected to include (test\\test rename-1.txt) and (test) got (${{ steps.changed-files-dir-names-specific-include-files.outputs.all_changed_files }})"
exit 1
shell:
bash
- name: Run changed-files with dir_names for specific files and an unmatched path
id: changed-files-dir-names-specific-unmatched-path
uses: ./
with:
base_sha: d1c0ee4
sha: 4d04215
fetch_depth: 60000
dir_names: true
files: unknown/**
json: true
- name: Show output
run: |
echo '${{ toJSON(steps.changed-files-dir-names-specific-unmatched-path.outputs) }}'
shell:
bash
- name: Check dir_names output
if: |
(
steps.changed-files-dir-names-specific-unmatched-path.outputs.all_changed_files != '[]' ||
steps.changed-files-dir-names-specific-unmatched-path.outputs.any_changed == 'true' ||
steps.changed-files-dir-names-specific-unmatched-path.outputs.all_changed_files_count != '0'
)
run: |
echo "Invalid output: Expected empty array and any_changed to be false got (${{ steps.changed-files-dir-names-specific-unmatched-path.outputs.all_changed_files }}) and (${{ steps.changed-files-dir-names-specific-unmatched-path.outputs.any_changed }})"
exit 1
shell:
bash
- name: Run changed-files with forward slash separator
id: changed-files-forward-slash
uses: ./