Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using find instead of ** to locate Dockerfiles #6096

Merged
merged 1 commit into from
Jun 4, 2024
Merged
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
7 changes: 2 additions & 5 deletions scripts/check-go-toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

set -eo pipefail

# enable double-star
shopt -s globstar

fail=0
bad() {
echo -e "$@" >/dev/stderr
Expand All @@ -21,7 +18,7 @@ root="$(git rev-parse --show-toplevel)"
# this SHOULD match the dependencies in the goversion-lint check to avoid skipping it

# check dockerfiles
for file in "$root"/**/Dockerfile; do
while read file; do
# find "FROM golang:1.22.3-alpine3.18 ..." lines
line="$(grep -i 'from golang:' "$file")"
# remove "from golang:" prefix
Expand All @@ -32,7 +29,7 @@ for file in "$root"/**/Dockerfile; do
if [[ "$version" != "$target" ]]; then
bad "Wrong Go version in file $file:\n\t$line"
fi
done
done < <( find "$root" -name Dockerfile )

# check workflows
codecov_file="$root/.github/workflows/codecov.yml"
Expand Down
Loading