Skip to content

Commit

Permalink
exclude files
Browse files Browse the repository at this point in the history
  • Loading branch information
dmcwhorter-ddl committed Oct 29, 2024
1 parent d81efd0 commit 08f3e7f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bin/pre-commit/check-aws-partition.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ exec 1>&2

check_aws_partition() {
declare -A failed_files
exclude_patterns=("policy/AWSLambdaExecute", "README.md")
exclude_patterns=("policy/AWSLambdaExecute")
exclude_files=("README.md")

for file in "$@"; do
if grep -q "arn:aws" "${file}"; then
Expand All @@ -15,6 +16,12 @@ check_aws_partition() {
break
fi
done
for exclude_file in "${exclude_files[@]}"; do
if [ "$file" = "$exclude_file" ]; then
skip_file=true
break
fi
done

if [ "$skip_file" = false ]; then
failed_files["${file}"]=1
Expand Down

0 comments on commit 08f3e7f

Please sign in to comment.