Skip to content

Commit 39e1997

Browse files
committed
ci: Improve .git directory exclusion in bash linter
The `find` commands used to locate bash scripts in the CI workflow previously used `./.git/*` to exclude the Git repository directory. This pattern is less robust as it specifically targets a `.git` directory directly under the current working directory. By changing the pattern to `*/.git/*`, the `find` command will now correctly exclude any `.git` directory found at any depth within the repository. This ensures that internal Git files, including those from submodules or other nested Git structures, are consistently ignored by the bash script linter.
1 parent 70623c5 commit 39e1997

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,15 @@ jobs:
107107
# Add all .sh files
108108
while IFS= read -r -d '' file; do
109109
bash_files+=("$file")
110-
done < <(find . -name "*.sh" -type f -not -path "*/node_modules/*" -not -path "./.git/*" -not -path "./.augment/*" -print0)
110+
done < <(find . -name "*.sh" -type f -not -path "*/node_modules/*" -not -path "*/.git/*" -not -path "./.augment/*" -print0)
111111
112112
# Add files with bash shebangs (excluding .sh files already found)
113113
while IFS= read -r -d '' file; do
114114
# Skip if it's already a .sh file
115115
if [[ "$file" != *.sh ]]; then
116116
bash_files+=("$file")
117117
fi
118-
done < <(find . -path "*/node_modules/*" -prune -o -type f -not -path "./.git/*" -not -path "./.augment/*" -exec grep -q "^#!/bin/bash\|^#!/usr/bin/env bash" {} \; -print0 2>/dev/null)
118+
done < <(find . -path "*/node_modules/*" -prune -o -type f -not -path "*/.git/*" -not -path "./.augment/*" -exec grep -q "^#!/bin/bash\|^#!/usr/bin/env bash" {} \; -print0 2>/dev/null)
119119
120120
if [ ${#bash_files[@]} -eq 0 ]; then
121121
echo "ℹ️ No bash scripts found in the repository - skipping bash syntax validation"

0 commit comments

Comments
 (0)