Skip to content

Commit

Permalink
fix: bug with outputs when json is set to true (#1531)
Browse files Browse the repository at this point in the history
Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Sep 4, 2023
1 parent fd460fa commit 8d335b7
Show file tree
Hide file tree
Showing 7 changed files with 362 additions and 150 deletions.
33 changes: 31 additions & 2 deletions .github/workflows/test.yml
Expand Up @@ -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 }})"
Expand All @@ -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: ./
Expand Down

0 comments on commit 8d335b7

Please sign in to comment.