Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ inputs:
workdir:
description: 'Working directory relative to the root directory.'
default: '.'
file_find_pattern:
description: 'File find pattern for dupe-files'
default: '*.sql'
runs:
using: 'composite'
steps:
Expand All @@ -54,6 +57,7 @@ runs:
INPUT_FAIL_ON_ERROR: ${{ inputs.fail_on_error }}
INPUT_REVIEWDOG_FLAGS: ${{ inputs.reviewdog_flags }}
INPUT_WORKDIR: ${{ inputs.workdir }}
INPUT_FILE_FIND_PATTERN: ${{ inputs.file_find_pattern }}
branding:
icon: 'check-circle'
color: 'blue'
8 changes: 7 additions & 1 deletion script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}"

echo Scanning ${INPUT_DIRECTORY}

find ${INPUT_DIRECTORY} -type f | sed 's_.*/__' | awk -F"__" '{print $1}' | sort | uniq -d |
find ${INPUT_DIRECTORY} -type f -name "\"${INPUT_FILE_FIND_PATTERN}\"" | sed 's_.*/__' | awk -F"__" '{print $1}' | sort | uniq -d |
while read fileName
do
find $dirname -type f | grep "${fileName}" |
Expand All @@ -25,6 +25,12 @@ do
done
done

find ${INPUT_DIRECTORY} -type f -name "\"${INPUT_FILE_FIND_PATTERN}\"" | sed 's_.*/__' | awk -F"__" '{print $1}' | sort | grep '\.' |
while read fileName
do
echo "${fileName}: Invalid version format" >> .dupe.out
done

echo '::group::Found duplicate files'
cat .dupe.out
echo '::endgroup::'
Expand Down