diff --git a/action.yml b/action.yml index fd3baac..5fa9147 100644 --- a/action.yml +++ b/action.yml @@ -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: @@ -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' diff --git a/script.sh b/script.sh index 4a58751..60b16b9 100755 --- a/script.sh +++ b/script.sh @@ -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}" | @@ -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::'