Skip to content

Commit

Permalink
Using find instead of ** to locate Dockerfiles (cadence-workflow#6096)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrotx authored and timl3136 committed Jun 4, 2024
1 parent 88fed55 commit f954f8e
Showing 1 changed file with 2 additions and 5 deletions.
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

0 comments on commit f954f8e

Please sign in to comment.