mirror of
https://github.com/tj-actions/changed-files
synced 2025-01-29 13:34:51 +00:00
chore: update test (#1469)
Co-authored-by: GitHub Action <action@github.com> Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
This commit is contained in:
parent
0a814e4372
commit
52dbf3e3cf
5 changed files with 389 additions and 94 deletions
378
.github/workflows/test.yml
vendored
378
.github/workflows/test.yml
vendored
|
@ -816,7 +816,7 @@ jobs:
|
|||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
platform: [ubuntu-latest, ubuntu-22.04, macos-latest, macos-11] # TODO: Fix the test for windows adding the correct path separator and use windows-2022, windows-latest
|
||||
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||
fetch-depth: [0, 1, 2]
|
||||
|
||||
steps:
|
||||
|
@ -933,13 +933,20 @@ jobs:
|
|||
echo '${{ toJSON(steps.changed-files-dir-names-max-depth.outputs) }}'
|
||||
shell:
|
||||
bash
|
||||
- name: Check dir_names output
|
||||
if: "!contains(steps.changed-files-dir-names-max-depth.outputs.all_changed_files, 'test/test2/test3')"
|
||||
- name: Check dir_names output on non windows platform
|
||||
if: "!contains(steps.changed-files-dir-names-max-depth.outputs.all_changed_files, 'test/test2/test3') && runner.os != 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected to include (test/test2/test3) got (${{ steps.changed-files-dir-names-max-depth.outputs.all_changed_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Check dir_names output on windows platform
|
||||
if: "!contains(steps.changed-files-dir-names-max-depth.outputs.all_changed_files, 'test\\test2\\test3') && runner.os == 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected to not include (test\\test2\\test3) got (${{ steps.changed-files-dir-names-max-depth.outputs.all_changed_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Run changed-files with dir_names and dir_names_exclude_current_dir
|
||||
id: changed-files-dir-names-exclude-root
|
||||
uses: ./
|
||||
|
@ -1019,13 +1026,28 @@ jobs:
|
|||
echo '${{ toJSON(steps.changed-files-dir-names-specific-include-files.outputs) }}'
|
||||
shell:
|
||||
bash
|
||||
- name: Check dir_names output
|
||||
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')"
|
||||
- name: Check dir_names output on non windows platform
|
||||
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')
|
||||
) && 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: Check dir_names output on windows platform
|
||||
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')
|
||||
) && 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 forward slash separator
|
||||
id: changed-files-forward-slash
|
||||
uses: ./
|
||||
|
@ -1123,20 +1145,34 @@ jobs:
|
|||
echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files-1.outputs) }}'
|
||||
shell:
|
||||
bash
|
||||
- name: Check all_old_new_renamed_files output
|
||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-1.outputs.all_old_new_renamed_files, 'test/test rename 1.txt,test/test rename-1.txt')"
|
||||
- name: Check all_old_new_renamed_files output on non windows platform
|
||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-1.outputs.all_old_new_renamed_files, 'test/test rename 1.txt,test/test rename-1.txt') && runner.os != 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected to include (test/test rename 1.txt,test/test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files-1.outputs.all_old_new_renamed_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Check the renamed_files output
|
||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-1.outputs.renamed_files, 'test/test rename-1.txt')"
|
||||
- name: Check all_old_new_renamed_files output on windows platform
|
||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-1.outputs.all_old_new_renamed_files, 'test\\test rename 1.txt,test\\test rename-1.txt') && runner.os == 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected to not include (test\\test rename 1.txt,test\\test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files-1.outputs.all_old_new_renamed_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Check the renamed_files output on non windows platform
|
||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-1.outputs.renamed_files, 'test/test rename-1.txt') && runner.os != 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected to include (test/test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files-1.outputs.renamed_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Check the renamed_files output on windows platform
|
||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-1.outputs.renamed_files, 'test\\test rename-1.txt') && runner.os == 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected to not include (test\\test rename-1.txt) got (${{ steps.changed-files-all-old-new-renamed-files-1.outputs.renamed_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Run changed-files for old new filenames test rename 2
|
||||
id: changed-files-all-old-new-renamed-files-2
|
||||
uses: ./
|
||||
|
@ -1150,20 +1186,34 @@ jobs:
|
|||
echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files-2.outputs) }}'
|
||||
shell:
|
||||
bash
|
||||
- name: Check all_old_new_renamed_files output
|
||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-2.outputs.all_old_new_renamed_files, 'test/test rename 2.txt,test/test rename-2.txt')"
|
||||
- name: Check all_old_new_renamed_files output on non windows platform
|
||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-2.outputs.all_old_new_renamed_files, 'test/test rename 2.txt,test/test rename-2.txt') && runner.os != 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected to include (test/test rename 2.txt test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2.outputs.all_old_new_renamed_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Check the renamed_files output
|
||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-2.outputs.renamed_files, 'test/test rename-2.txt')"
|
||||
- name: Check all_old_new_renamed_files output on windows platform
|
||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-2.outputs.all_old_new_renamed_files, 'test\\test rename 2.txt,test\\test rename-2.txt') && runner.os == 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected to not include (test\\test rename 2.txt test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2.outputs.all_old_new_renamed_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Check the renamed_files output on non windows platform
|
||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-2.outputs.renamed_files, 'test/test rename-2.txt') && runner.os != 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected to include (test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2.outputs.renamed_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Check the renamed_files output on windows platform
|
||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-2.outputs.renamed_files, 'test\\test rename-2.txt') && runner.os == 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected to not include (test\\test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2.outputs.renamed_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Run changed-files for old new filenames test rename 2 output as deleted and added
|
||||
id: changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added
|
||||
uses: ./
|
||||
|
@ -1178,27 +1228,48 @@ jobs:
|
|||
echo '${{ toJSON(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs) }}'
|
||||
shell:
|
||||
bash
|
||||
- name: Check all_old_new_renamed_files output
|
||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.all_old_new_renamed_files, 'test/test rename 2.txt,test/test rename-2.txt')"
|
||||
- name: Check all_old_new_renamed_files output on non windows platform
|
||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.all_old_new_renamed_files, 'test/test rename 2.txt,test/test rename-2.txt') && runner.os != 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected to include (test/test rename 2.txt test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.all_old_new_renamed_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Check deleted_files output
|
||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.deleted_files, 'test/test rename 2.txt')"
|
||||
- name: Check all_old_new_renamed_files output on windows platform
|
||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.all_old_new_renamed_files, 'test\\test rename 2.txt,test\\test rename-2.txt') && runner.os == 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected to not include (test\\test rename 2.txt test\\test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.all_old_new_renamed_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Check deleted_files output on non windows platform
|
||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.deleted_files, 'test/test rename 2.txt') && runner.os != 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected to include (test/test rename 2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.deleted_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Check added_files output
|
||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.added_files, 'test/test rename-2.txt')"
|
||||
- name: Check deleted_files output on windows platform
|
||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.deleted_files, 'test\\test rename 2.txt') && runner.os == 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected to not include (test\\test rename 2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.deleted_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Check added_files output on non windows platform
|
||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.added_files, 'test/test rename-2.txt') && runner.os != 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected to include (test/test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.added_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Check added_files output on windows platform
|
||||
if: "!contains(steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.added_files, 'test\\test rename-2.txt') && runner.os == 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected to not include (test\\test rename-2.txt) got (${{ steps.changed-files-all-old-new-renamed-files-2-output-as-deleted-and-added.outputs.added_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Run changed-files with specific files
|
||||
id: changed-files-specific
|
||||
uses: ./
|
||||
|
@ -1214,15 +1285,22 @@ jobs:
|
|||
echo '${{ toJSON(steps.changed-files-specific.outputs) }}'
|
||||
shell:
|
||||
bash
|
||||
- name: Check if a excluded file is not included in any_changed
|
||||
if: "contains(steps.changed-files-specific.outputs.all_changed_files, 'test/test/test.txt')"
|
||||
- name: Check if a excluded file is not included in any_changed on non windows platform
|
||||
if: "contains(steps.changed-files-specific.outputs.all_changed_files, 'test/test/test.txt') && runner.os != 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific.outputs.all_changed_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_changed for specific files
|
||||
if: "!contains(steps.changed-files-specific.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.all_changed_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific.outputs.all_changed_files, 'test/test.txt')"
|
||||
- name: Check if a excluded file is not included in any_changed on windows platform
|
||||
if: "contains(steps.changed-files-specific.outputs.all_changed_files, 'test\\test\\test.txt') && runner.os == 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected not to include (test\\test\\test.txt) got (${{ steps.changed-files-specific.outputs.all_changed_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_changed for specific files on non windows platform
|
||||
if: "!contains(steps.changed-files-specific.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.all_changed_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific.outputs.all_changed_files, 'test/test.txt') && runner.os != 'Windows'"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific.outputs.any_changed }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_changed }})"
|
||||
|
@ -1230,15 +1308,31 @@ jobs:
|
|||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Check if a excluded file is not included in any_modified
|
||||
if: "contains(steps.changed-files-specific.outputs.all_modified_files, 'test/test/test.txt')"
|
||||
- name: Verify any_changed for specific files on windows platform
|
||||
if: "!contains(steps.changed-files-specific.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.all_changed_files, '.github\\workflows\\test.yml') && !contains(steps.changed-files-specific.outputs.all_changed_files, 'test\\test.txt') && runner.os == 'Windows'"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific.outputs.any_changed }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_changed }})"
|
||||
exit 1
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Check if a excluded file is not included in any_modified on non windows platform
|
||||
if: "contains(steps.changed-files-specific.outputs.all_modified_files, 'test/test/test.txt') && runner.os != 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific.outputs.all_modified_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_modified for specific files
|
||||
if: "!contains(steps.changed-files-specific.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.all_modified_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific.outputs.all_modified_files, 'test/test.txt')"
|
||||
- name: Check if a excluded file is not included in any_modified on windows platform
|
||||
if: "contains(steps.changed-files-specific.outputs.all_modified_files, 'test\\test\\test.txt') && runner.os == 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected not to include (test\\test\\test.txt) got (${{ steps.changed-files-specific.outputs.all_modified_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_modified for specific files on non windows platform
|
||||
if: "!contains(steps.changed-files-specific.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.all_modified_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific.outputs.all_modified_files, 'test/test.txt') && runner.os != 'Windows'"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific.outputs.any_modified }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_modified }})"
|
||||
|
@ -1246,15 +1340,40 @@ jobs:
|
|||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Check if a excluded file is not included in any_deleted
|
||||
if: "contains(steps.changed-files-specific.outputs.deleted_files, 'test/test/test.txt')"
|
||||
- name: Verify any_modified for specific files on windows platform
|
||||
if: "!contains(steps.changed-files-specific.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.all_modified_files, '.github\\workflows\\test.yml') && !contains(steps.changed-files-specific.outputs.all_modified_files, 'test\\test.txt') && runner.os == 'Windows'"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific.outputs.any_modified }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_modified }})"
|
||||
exit 1
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Check if a excluded file is not included in any_deleted on non windows platform
|
||||
if: "contains(steps.changed-files-specific.outputs.deleted_files, 'test/test/test.txt') && runner.os != 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific.outputs.deleted_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_deleted for specific files
|
||||
if: "!contains(steps.changed-files-specific.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.deleted_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific.outputs.deleted_files, 'test/test.txt')"
|
||||
- name: Check if a excluded file is not included in any_deleted on windows platform
|
||||
if: "contains(steps.changed-files-specific.outputs.deleted_files, 'test\\test\\test.txt') && runner.os == 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected not to include (test\\test\\test.txt) got (${{ steps.changed-files-specific.outputs.deleted_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_deleted for specific files on non windows platform
|
||||
if: "!contains(steps.changed-files-specific.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.deleted_files, '.github/workflows/test.yml') && !contains(steps.changed-files-specific.outputs.deleted_files, 'test/test.txt') && runner.os != 'Windows'"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific.outputs.any_deleted }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_deleted }})"
|
||||
exit 1
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_deleted for specific files on windows platform
|
||||
if: "!contains(steps.changed-files-specific.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific.outputs.deleted_files, '.github\\workflows\\test.yml') && !contains(steps.changed-files-specific.outputs.deleted_files, 'test\\test.txt') && runner.os == 'Windows'"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific.outputs.any_deleted }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific.outputs.any_deleted }})"
|
||||
|
@ -1318,8 +1437,8 @@ jobs:
|
|||
echo '${{ toJSON(steps.changed-files-specific-comma.outputs) }}'
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_changed files comma separator
|
||||
if: "!contains(steps.changed-files-specific-comma.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.all_changed_files, '.github/workflows/test.yml')"
|
||||
- name: Verify any_changed files comma separator on non windows platform
|
||||
if: "!contains(steps.changed-files-specific-comma.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.all_changed_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-comma.outputs.any_changed }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_changed }})"
|
||||
|
@ -1327,8 +1446,17 @@ jobs:
|
|||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_modified files comma separator
|
||||
if: "!contains(steps.changed-files-specific-comma.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.all_modified_files, '.github/workflows/test.yml')"
|
||||
- name: Verify any_changed files comma separator on windows platform
|
||||
if: "!contains(steps.changed-files-specific-comma.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.all_changed_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-comma.outputs.any_changed }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_changed }})"
|
||||
exit 1
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_modified files comma separator on non windows platform
|
||||
if: "!contains(steps.changed-files-specific-comma.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.all_modified_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-comma.outputs.any_modified }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_modified }})"
|
||||
|
@ -1336,8 +1464,26 @@ jobs:
|
|||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_deleted files comma separator
|
||||
if: "!contains(steps.changed-files-specific-comma.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.deleted_files, '.github/workflows/test.yml')"
|
||||
- name: Verify any_modified files comma separator on windows platform
|
||||
if: "!contains(steps.changed-files-specific-comma.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.all_modified_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-comma.outputs.any_modified }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_modified }})"
|
||||
exit 1
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_deleted files comma separator on non windows platform
|
||||
if: "!contains(steps.changed-files-specific-comma.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.deleted_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-comma.outputs.any_deleted }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_deleted }})"
|
||||
exit 1
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_deleted files comma separator on windows platform
|
||||
if: "!contains(steps.changed-files-specific-comma.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-comma.outputs.deleted_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-comma.outputs.any_deleted }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma.outputs.any_deleted }})"
|
||||
|
@ -1358,8 +1504,8 @@ jobs:
|
|||
echo '${{ toJSON(steps.changed-files-specific-pipe.outputs) }}'
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_changed files comma separator
|
||||
if: "!contains(steps.changed-files-specific-pipe.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.all_changed_files, '.github/workflows/test.yml')"
|
||||
- name: Verify any_changed files comma separator on non windows platform
|
||||
if: "!contains(steps.changed-files-specific-pipe.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.all_changed_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-pipe.outputs.any_changed }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_changed }})"
|
||||
|
@ -1367,8 +1513,17 @@ jobs:
|
|||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_modified files comma separator
|
||||
if: "!contains(steps.changed-files-specific-pipe.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.all_modified_files, '.github/workflows/test.yml')"
|
||||
- name: Verify any_changed files comma separator on windows platform
|
||||
if: "!contains(steps.changed-files-specific-pipe.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.all_changed_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-pipe.outputs.any_changed }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_changed }})"
|
||||
exit 1
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_modified files comma separator on non windows platform
|
||||
if: "!contains(steps.changed-files-specific-pipe.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.all_modified_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-pipe.outputs.any_modified }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_modified }})"
|
||||
|
@ -1376,8 +1531,26 @@ jobs:
|
|||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_deleted files comma separator
|
||||
if: "!contains(steps.changed-files-specific-pipe.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.deleted_files, '.github/workflows/test.yml')"
|
||||
- name: Verify any_modified files comma separator on windows platform
|
||||
if: "!contains(steps.changed-files-specific-pipe.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.all_modified_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-pipe.outputs.any_modified }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_modified }})"
|
||||
exit 1
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_deleted files comma separator on non windows platform
|
||||
if: "!contains(steps.changed-files-specific-pipe.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.deleted_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-pipe.outputs.any_deleted }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_deleted }})"
|
||||
exit 1
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_deleted files comma separator on windows platform
|
||||
if: "!contains(steps.changed-files-specific-pipe.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-pipe.outputs.deleted_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-pipe.outputs.any_deleted }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-pipe.outputs.any_deleted }})"
|
||||
|
@ -1398,8 +1571,8 @@ jobs:
|
|||
echo '${{ toJSON(steps.changed-files-specific-forward-slash.outputs) }}'
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_changed files forward slash separator
|
||||
if: "!contains(steps.changed-files-specific-forward-slash.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.all_changed_files, '.github/workflows/test.yml')"
|
||||
- name: Verify any_changed files forward slash separator on non windows platform
|
||||
if: "!contains(steps.changed-files-specific-forward-slash.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.all_changed_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_changed }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_changed }})"
|
||||
|
@ -1407,8 +1580,17 @@ jobs:
|
|||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_modified files forward slash separator
|
||||
if: "!contains(steps.changed-files-specific-forward-slash.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.all_modified_files, '.github/workflows/test.yml')"
|
||||
- name: Verify any_changed files forward slash separator on windows platform
|
||||
if: "!contains(steps.changed-files-specific-forward-slash.outputs.all_changed_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.all_changed_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_changed }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_changed }})"
|
||||
exit 1
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_modified files forward slash separator on non windows platform
|
||||
if: "!contains(steps.changed-files-specific-forward-slash.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.all_modified_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_modified }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_modified }})"
|
||||
|
@ -1416,8 +1598,26 @@ jobs:
|
|||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_deleted files forward slash separator
|
||||
if: "!contains(steps.changed-files-specific-forward-slash.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.deleted_files, '.github/workflows/test.yml')"
|
||||
- name: Verify any_modified files forward slash separator on windows platform
|
||||
if: "!contains(steps.changed-files-specific-forward-slash.outputs.all_modified_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.all_modified_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_modified }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_modified }})"
|
||||
exit 1
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_deleted files forward slash separator on non windows platform
|
||||
if: "!contains(steps.changed-files-specific-forward-slash.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.deleted_files, '.github/workflows/test.yml') && runner.os != 'Windows'"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_deleted }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_deleted }})"
|
||||
exit 1
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_deleted files forward slash separator on windows platform
|
||||
if: "!contains(steps.changed-files-specific-forward-slash.outputs.deleted_files, 'action.yml') && !contains(steps.changed-files-specific-forward-slash.outputs.deleted_files, '.github\\workflows\\test.yml') && runner.os == 'Windows'"
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-forward-slash.outputs.any_deleted }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-forward-slash.outputs.any_deleted }})"
|
||||
|
@ -1434,14 +1634,26 @@ jobs:
|
|||
test/changed-files-list.txt
|
||||
files: |
|
||||
**/workflows/greetings.yml
|
||||
- name: Check if a excluded file is not included in any_changed
|
||||
if: contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test/test/test.txt')
|
||||
- name: Show output
|
||||
run: |
|
||||
echo '${{ toJSON(steps.changed-files-specific-source-file.outputs) }}'
|
||||
shell:
|
||||
bash
|
||||
- name: Check if a excluded file is not included in any_changed on non windows platform
|
||||
if: "contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test/test/test.txt') && runner.os != 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific-source-file.outputs.all_changed_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_changed from source files
|
||||
- name: Check if a excluded file is not included in any_changed on windows platform
|
||||
if: "contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test\\test\\test.txt') && runner.os == 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected not to include (test\\test\\test.txt) got (${{ steps.changed-files-specific-source-file.outputs.all_changed_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_changed from source files on non windows platform
|
||||
if: |
|
||||
(
|
||||
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'action.yml') &&
|
||||
|
@ -1450,7 +1662,8 @@ jobs:
|
|||
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test/test2/test.txt') &&
|
||||
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, 'test/test2/test3/test4/test.txt') &&
|
||||
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, '[test new].txt') &&
|
||||
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, '.github/workflows/greetings.yml')
|
||||
!contains(steps.changed-files-specific-source-file.outputs.all_changed_files, '.github/workflows/greetings.yml') &&
|
||||
runner.os != 'Windows'
|
||||
)
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-source-file.outputs.any_changed }}" != "false" ]]; then
|
||||
|
@ -1459,14 +1672,21 @@ jobs:
|
|||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Check if a excluded file is not included in any_modified
|
||||
if: contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test/test/test.txt')
|
||||
- name: Check if a excluded file is not included in any_modified on non windows platform
|
||||
if: "contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test/test/test.txt') && runner.os != 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific-source-file.outputs.all_modified_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_modified from source files
|
||||
- name: Check if a excluded file is not included in any_modified on windows platform
|
||||
if: "contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test\\test\\test.txt') && runner.os == 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected not to include (test\\test\\test.txt) got (${{ steps.changed-files-specific-source-file.outputs.all_modified_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_modified from source files on non windows platform
|
||||
if: |
|
||||
(
|
||||
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'action.yml') &&
|
||||
|
@ -1475,7 +1695,8 @@ jobs:
|
|||
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test/test2/test.txt') &&
|
||||
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, 'test/test2/test3/test4/test.txt') &&
|
||||
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, '[test new].txt') &&
|
||||
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, '.github/workflows/greetings.yml')
|
||||
!contains(steps.changed-files-specific-source-file.outputs.all_modified_files, '.github/workflows/greetings.yml') &&
|
||||
runner.os != 'Windows'
|
||||
)
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-source-file.outputs.any_modified }}" != "false" ]]; then
|
||||
|
@ -1484,14 +1705,21 @@ jobs:
|
|||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Check if a excluded file is not included in any_deleted
|
||||
if: contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test/test/test.txt')
|
||||
- name: Check if a excluded file is not included in any_deleted on non windows platform
|
||||
if: "contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test/test/test.txt') && runner.os != 'Windows'"
|
||||
run: |
|
||||
echo "Invalid output: Expected not to include (test/test/test.txt) got (${{ steps.changed-files-specific-source-file.outputs.deleted_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_deleted from source files
|
||||
- name: Check if a excluded file is not included in any_deleted on windows platform
|
||||
if: contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test\\test\\test.txt')
|
||||
run: |
|
||||
echo "Invalid output: Expected not to include (test\\test\\test.txt) got (${{ steps.changed-files-specific-source-file.outputs.deleted_files }})"
|
||||
exit 1
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_deleted from source files on non windows platform
|
||||
if: |
|
||||
(
|
||||
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'action.yml') &&
|
||||
|
@ -1500,7 +1728,8 @@ jobs:
|
|||
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test/test2/test.txt') &&
|
||||
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, 'test/test2/test3/test4/test.txt') &&
|
||||
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, '[test new].txt') &&
|
||||
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, '.github/workflows/greetings.yml')
|
||||
!contains(steps.changed-files-specific-source-file.outputs.deleted_files, '.github/workflows/greetings.yml') &&
|
||||
runner.os != 'Windows'
|
||||
)
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-source-file.outputs.any_deleted }}" != "false" ]]; then
|
||||
|
@ -1526,7 +1755,7 @@ jobs:
|
|||
echo '${{ toJSON(steps.changed-files-specific-comma-source-file.outputs) }}'
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_changed files comma separator
|
||||
- name: Verify any_changed files comma separator from source files on non windows platform
|
||||
if: |
|
||||
(
|
||||
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'action.yml') &&
|
||||
|
@ -1534,7 +1763,8 @@ jobs:
|
|||
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'test/test.txt') &&
|
||||
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'test/test2/test.txt') &&
|
||||
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, 'test/test2/test3/test4/test.txt') &&
|
||||
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, '[test new].txt')
|
||||
!contains(steps.changed-files-specific-comma-source-file.outputs.all_changed_files, '[test new].txt') &&
|
||||
runner.os != 'Windows'
|
||||
)
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-comma-source-file.outputs.any_changed }}" != "false" ]]; then
|
||||
|
@ -1543,7 +1773,7 @@ jobs:
|
|||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_modified files comma separator
|
||||
- name: Verify any_modified files comma separator from source files on non windows platform
|
||||
if: |
|
||||
(
|
||||
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'action.yml') &&
|
||||
|
@ -1551,7 +1781,8 @@ jobs:
|
|||
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'test/test.txt') &&
|
||||
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'test/test2/test.txt') &&
|
||||
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, 'test/test2/test3/test4/test.txt') &&
|
||||
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, '[test new].txt')
|
||||
!contains(steps.changed-files-specific-comma-source-file.outputs.all_modified_files, '[test new].txt') &&
|
||||
runner.os != 'Windows'
|
||||
)
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-comma-source-file.outputs.any_modified }}" != "false" ]]; then
|
||||
|
@ -1560,23 +1791,6 @@ jobs:
|
|||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Verify any_deleted files with comma separator
|
||||
if: |
|
||||
(
|
||||
!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, 'action.yml') &&
|
||||
!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, '.github/workflows/test.yml') &&
|
||||
!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, 'test/test.txt') &&
|
||||
!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, 'test/test2/test.txt') &&
|
||||
!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, 'test/test2/test3/test4/test.txt') &&
|
||||
!contains(steps.changed-files-specific-comma-source-file.outputs.deleted_files, '[test new].txt')
|
||||
)
|
||||
run: |
|
||||
if [[ "${{ steps.changed-files-specific-comma-source-file.outputs.any_deleted }}" != "false" ]]; then
|
||||
echo "Invalid output: Expected (false) got (${{ steps.changed-files-specific-comma-source-file.outputs.any_deleted }})"
|
||||
exit 1
|
||||
fi
|
||||
shell:
|
||||
bash
|
||||
- name: Get branch name
|
||||
id: branch-name
|
||||
uses: tj-actions/branch-names@v7
|
||||
|
|
BIN
dist/index.js
generated
vendored
BIN
dist/index.js
generated
vendored
Binary file not shown.
BIN
dist/index.js.map
generated
vendored
BIN
dist/index.js.map
generated
vendored
Binary file not shown.
|
@ -74,6 +74,7 @@ describe('utils test', () => {
|
|||
|
||||
// Tests that the function returns the correct dirname when the relative path is a Windows drive root and excludeCurrentDir is true
|
||||
it('test_windows_drive_root_and_exclude_current_dir_is_true', () => {
|
||||
mockedPlatform('win32')
|
||||
const result = getDirnameMaxDepth({
|
||||
relativePath: 'C:\\',
|
||||
dirNamesMaxDepth: 1,
|
||||
|
@ -107,6 +108,7 @@ describe('utils test', () => {
|
|||
|
||||
// Tests that getDirnameMaxDepth returns the correct output for a Windows UNC root path
|
||||
it('test_windows_unc_root', () => {
|
||||
mockedPlatform('win32')
|
||||
const input = {
|
||||
relativePath: '\\hello',
|
||||
dirNamesMaxDepth: 2,
|
||||
|
@ -118,6 +120,7 @@ describe('utils test', () => {
|
|||
|
||||
// Tests that getDirnameMaxDepth returns an empty string when given a Windows UNC root and excludeCurrentDir is true
|
||||
it('test_windows_unc_root_exclude_current_dir', () => {
|
||||
mockedPlatform('win32')
|
||||
const relativePath = '\\hello'
|
||||
const result = getDirnameMaxDepth({
|
||||
relativePath,
|
||||
|
@ -152,6 +155,7 @@ describe('utils test', () => {
|
|||
|
||||
// Tests that the function returns the correct dirname for a valid Windows UNC root path
|
||||
it('test windows unc root path', () => {
|
||||
mockedPlatform('win32')
|
||||
expect(getDirname('\\helloworld')).toEqual('.')
|
||||
})
|
||||
|
||||
|
@ -162,6 +166,7 @@ describe('utils test', () => {
|
|||
|
||||
// Tests that the function returns the correct dirname for a Windows UNC root path with a trailing slash
|
||||
it('test windows unc root path with trailing slash', () => {
|
||||
mockedPlatform('win32')
|
||||
expect(getDirname('\\hello\\world\\')).toEqual('.')
|
||||
})
|
||||
|
||||
|
@ -172,6 +177,7 @@ describe('utils test', () => {
|
|||
|
||||
// Tests that the function returns the correct dirname for a Windows UNC root path with multiple slashes
|
||||
it('test windows unc root path with multiple slashes', () => {
|
||||
mockedPlatform('win32')
|
||||
expect(getDirname('\\hello\\world')).toEqual('.')
|
||||
})
|
||||
})
|
||||
|
@ -194,6 +200,15 @@ describe('utils test', () => {
|
|||
expect(actualOutput).toEqual(expectedOutput)
|
||||
})
|
||||
|
||||
// Tests that forward slashes are normalized on Windows
|
||||
it('test mixed slashes windows', () => {
|
||||
mockedPlatform('win32')
|
||||
const input = 'path/to/file'
|
||||
const expectedOutput = 'path\\to\\file'
|
||||
const actualOutput = normalizeSeparators(input)
|
||||
expect(actualOutput).toEqual(expectedOutput)
|
||||
})
|
||||
|
||||
// Tests that mixed slashes are normalized on Windows
|
||||
it('test mixed slashes windows', () => {
|
||||
mockedPlatform('win32')
|
||||
|
@ -221,6 +236,7 @@ describe('utils test', () => {
|
|||
|
||||
// Tests that UNC format is preserved on Windows
|
||||
it('test unc format windows', () => {
|
||||
mockedPlatform('win32')
|
||||
const input = '\\\\hello\\world'
|
||||
const expectedOutput = '\\\\hello\\world'
|
||||
const actualOutput = normalizeSeparators(input)
|
||||
|
@ -229,6 +245,7 @@ describe('utils test', () => {
|
|||
|
||||
// Tests that a drive root is preserved on Windows
|
||||
it('test drive root windows', () => {
|
||||
mockedPlatform('win32')
|
||||
const input = 'C:\\'
|
||||
const expectedOutput = 'C:\\'
|
||||
const actualOutput = normalizeSeparators(input)
|
||||
|
@ -236,8 +253,6 @@ describe('utils test', () => {
|
|||
})
|
||||
})
|
||||
|
||||
// Generated by CodiumAI
|
||||
|
||||
describe('getFilteredChangedFiles', () => {
|
||||
// Tests that the function returns an empty object when allDiffFiles and filePatterns are empty
|
||||
it('should return an empty object when allDiffFiles and filePatterns are empty', async () => {
|
||||
|
@ -312,7 +327,7 @@ describe('utils test', () => {
|
|||
})
|
||||
})
|
||||
|
||||
// Tests that the function returns only the files that match the file patterns
|
||||
// Tests that the function returns only the files that match the file patterns on non windows platforms
|
||||
it('should return only the files that match the file patterns', async () => {
|
||||
const allDiffFiles = {
|
||||
[ChangeTypeEnum.Added]: [
|
||||
|
@ -320,7 +335,7 @@ describe('utils test', () => {
|
|||
'file2.md',
|
||||
'file3.txt',
|
||||
'test/dir/file4.txt',
|
||||
'/test/dir/file5.txt',
|
||||
'test/dir/file5.txt',
|
||||
'dir/file6.md'
|
||||
],
|
||||
[ChangeTypeEnum.Copied]: [],
|
||||
|
@ -347,7 +362,44 @@ describe('utils test', () => {
|
|||
})
|
||||
})
|
||||
|
||||
// Tests that the function returns only the files that match the file patterns with globstar
|
||||
// Tests that the function returns only the files that match the file patterns on windows
|
||||
it('should return only the files that match the file patterns on windows', async () => {
|
||||
mockedPlatform('win32')
|
||||
const allDiffFiles = {
|
||||
[ChangeTypeEnum.Added]: [
|
||||
'file1.txt',
|
||||
'file2.md',
|
||||
'file3.txt',
|
||||
'test\\dir\\file4.txt',
|
||||
'test\\dir\\file5.txt',
|
||||
'dir\\file6.md'
|
||||
],
|
||||
[ChangeTypeEnum.Copied]: [],
|
||||
[ChangeTypeEnum.Deleted]: [],
|
||||
[ChangeTypeEnum.Modified]: [],
|
||||
[ChangeTypeEnum.Renamed]: [],
|
||||
[ChangeTypeEnum.TypeChanged]: [],
|
||||
[ChangeTypeEnum.Unmerged]: [],
|
||||
[ChangeTypeEnum.Unknown]: []
|
||||
}
|
||||
const result = await getFilteredChangedFiles({
|
||||
allDiffFiles,
|
||||
filePatterns: ['*.txt']
|
||||
})
|
||||
|
||||
expect(result).toEqual({
|
||||
[ChangeTypeEnum.Added]: ['file1.txt', 'file3.txt'],
|
||||
[ChangeTypeEnum.Copied]: [],
|
||||
[ChangeTypeEnum.Deleted]: [],
|
||||
[ChangeTypeEnum.Modified]: [],
|
||||
[ChangeTypeEnum.Renamed]: [],
|
||||
[ChangeTypeEnum.TypeChanged]: [],
|
||||
[ChangeTypeEnum.Unmerged]: [],
|
||||
[ChangeTypeEnum.Unknown]: []
|
||||
})
|
||||
})
|
||||
|
||||
// Tests that the function returns only the files that match the file patterns with globstar on non windows platforms
|
||||
it('should return only the files that match the file patterns with globstar', async () => {
|
||||
const allDiffFiles = {
|
||||
[ChangeTypeEnum.Added]: [
|
||||
|
@ -355,7 +407,7 @@ describe('utils test', () => {
|
|||
'file2.md',
|
||||
'file3.txt',
|
||||
'test/dir/file4.txt',
|
||||
'/test/dir/file5.txt',
|
||||
'test/dir/file5.txt',
|
||||
'dir/file6.md'
|
||||
],
|
||||
[ChangeTypeEnum.Copied]: [],
|
||||
|
@ -375,7 +427,7 @@ describe('utils test', () => {
|
|||
'file1.txt',
|
||||
'file3.txt',
|
||||
'test/dir/file4.txt',
|
||||
'/test/dir/file5.txt'
|
||||
'test/dir/file5.txt'
|
||||
],
|
||||
[ChangeTypeEnum.Copied]: [],
|
||||
[ChangeTypeEnum.Deleted]: [],
|
||||
|
@ -387,6 +439,35 @@ describe('utils test', () => {
|
|||
})
|
||||
})
|
||||
|
||||
// Tests that the function returns only the files that match the file patterns with globstar on windows
|
||||
it('should return only the files that match the file patterns with globstar on windows', async () => {
|
||||
mockedPlatform('win32')
|
||||
const allDiffFiles = {
|
||||
[ChangeTypeEnum.Added]: ['test\\test rename-1.txt'],
|
||||
[ChangeTypeEnum.Copied]: [],
|
||||
[ChangeTypeEnum.Deleted]: [],
|
||||
[ChangeTypeEnum.Modified]: [],
|
||||
[ChangeTypeEnum.Renamed]: [],
|
||||
[ChangeTypeEnum.TypeChanged]: [],
|
||||
[ChangeTypeEnum.Unmerged]: [],
|
||||
[ChangeTypeEnum.Unknown]: []
|
||||
}
|
||||
const result = await getFilteredChangedFiles({
|
||||
allDiffFiles,
|
||||
filePatterns: ['test/**']
|
||||
})
|
||||
expect(result).toEqual({
|
||||
[ChangeTypeEnum.Added]: ['test\\test rename-1.txt'],
|
||||
[ChangeTypeEnum.Copied]: [],
|
||||
[ChangeTypeEnum.Deleted]: [],
|
||||
[ChangeTypeEnum.Modified]: [],
|
||||
[ChangeTypeEnum.Renamed]: [],
|
||||
[ChangeTypeEnum.TypeChanged]: [],
|
||||
[ChangeTypeEnum.Unmerged]: [],
|
||||
[ChangeTypeEnum.Unknown]: []
|
||||
})
|
||||
})
|
||||
|
||||
// Tests that the function returns an empty object when there are no files that match the file patterns
|
||||
it('should return an empty object when there are no files that match the file patterns', async () => {
|
||||
const allDiffFiles = {
|
||||
|
|
10
src/utils.ts
10
src/utils.ts
|
@ -609,7 +609,7 @@ export const getFilteredChangedFiles = async ({
|
|||
dot: true,
|
||||
windows: isWin,
|
||||
noext: true
|
||||
})
|
||||
}).map(normalizeSeparators)
|
||||
} else {
|
||||
changedFiles[changeType as ChangeTypeEnum] = files
|
||||
}
|
||||
|
@ -967,7 +967,7 @@ export const getFilePatterns = async ({
|
|||
filePatterns = filePatterns.replace(/\r/g, '\n')
|
||||
}
|
||||
|
||||
core.debug(`file patterns: ${filePatterns}`)
|
||||
core.debug(`Input file patterns: ${filePatterns}`)
|
||||
|
||||
return filePatterns
|
||||
.trim()
|
||||
|
@ -977,10 +977,10 @@ export const getFilePatterns = async ({
|
|||
if (pattern.endsWith('/')) {
|
||||
return `${pattern}**`
|
||||
} else {
|
||||
const pathParts = pattern.split(path.sep)
|
||||
const pathParts = pattern.split('/')
|
||||
const lastPart = pathParts[pathParts.length - 1]
|
||||
if (!lastPart.includes('.')) {
|
||||
return `${pattern}${path.sep}**`
|
||||
if (!lastPart.includes('.') && !lastPart.includes('*')) {
|
||||
return `${pattern}/**`
|
||||
} else {
|
||||
return pattern
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue