Dedupe output file names. (#153)

This commit is contained in:
Tonye Jack
2021-08-06 06:14:50 -04:00
committed by GitHub
parent dc688ad0b2
commit 75933dc40b
2 changed files with 29 additions and 10 deletions

View File

@@ -108,6 +108,25 @@ jobs:
echo "${{ toJSON(steps.changed-files-specific.outputs) }}"
shell:
bash
- name: Run changed-files with specific files comma check duplicates
id: changed-files-specific-duplicate-output
uses: ./
with:
files: |
entrypoint.sh
*.sh
- name: Verify all_changed_files files has no duplicates
if: contains(steps.changed-files-specific-duplicate-output.outputs.all_modified_files, 'entrypoint.sh')
run: |
ALL_CHANGED_FILES=(${{ steps.changed-files-specific-duplicate-output.outputs.all_modified_files }})
UNIQUE_ALL_CHANGED_FILES=$(echo "$ALL_CHANGED_FILES" | tr ' ' '\n' | sort -u | xargs)
if [[ "$ALL_CHANGED_FILES[@]" != "$UNIQUE_ALL_CHANGED_FILES[@]" ]]; then
echo "Duplicate output: Expected "$UNIQUE_ALL_CHANGED_FILES" got $ALL_CHANGED_FILES"
exit 1
fi
shell:
bash
- name: Run changed-files with specific files comma separator
id: changed-files-specific-comma
uses: ./