浏览代码

Merge pull request #14134 from infosiftr/collect-naughty

Validate all naughty even in the face of one naughty
yosifkit 2 年之前
父节点
当前提交
04dd543382
共有 1 个文件被更改,包括 8 次插入4 次删除
  1. 8 4
      .github/workflows/naughty.sh

+ 8 - 4
.github/workflows/naughty.sh

@@ -17,6 +17,8 @@ export BASHBREW_LIBRARY="$PWD/library"
 
 
 bashbrew from --uniq "$@" > /dev/null
 bashbrew from --uniq "$@" > /dev/null
 
 
+numNaughty=0
+
 if badTags="$(bashbrew list "$@" | grep -E ':.+latest.*|:.*latest.+')" && [ -n "$badTags" ]; then
 if badTags="$(bashbrew list "$@" | grep -E ':.+latest.*|:.*latest.+')" && [ -n "$badTags" ]; then
 	echo >&2
 	echo >&2
 	echo >&2 "Incorrectly formatted 'latest' tags detected:"
 	echo >&2 "Incorrectly formatted 'latest' tags detected:"
@@ -24,7 +26,7 @@ if badTags="$(bashbrew list "$@" | grep -E ':.+latest.*|:.*latest.+')" && [ -n "
 	echo >&2
 	echo >&2
 	echo >&2 'Read https://github.com/docker-library/official-images#tags-and-aliases for more details.'
 	echo >&2 'Read https://github.com/docker-library/official-images#tags-and-aliases for more details.'
 	echo >&2
 	echo >&2
-	exit 1
+	(( ++numNaughty ))
 fi
 fi
 
 
 naughtyFrom="$(./naughty-from.sh "$@")"
 naughtyFrom="$(./naughty-from.sh "$@")"
@@ -36,7 +38,7 @@ if [ -n "$naughtyFrom" ]; then
 	echo >&2
 	echo >&2
 	echo >&2 'Read https://github.com/docker-library/official-images#multiple-architectures for more details.'
 	echo >&2 'Read https://github.com/docker-library/official-images#multiple-architectures for more details.'
 	echo >&2
 	echo >&2
-	exit 1
+	(( ++numNaughty ))
 fi
 fi
 
 
 naughtyConstraints="$(./naughty-constraints.sh "$@")"
 naughtyConstraints="$(./naughty-constraints.sh "$@")"
@@ -46,7 +48,7 @@ if [ -n "$naughtyConstraints" ]; then
 	echo >&2
 	echo >&2
 	echo >&2 "$naughtyConstraints"
 	echo >&2 "$naughtyConstraints"
 	echo >&2
 	echo >&2
-	exit 1
+	(( ++numNaughty ))
 fi
 fi
 
 
 naughtyCommits="$(./naughty-commits.sh "$@")"
 naughtyCommits="$(./naughty-commits.sh "$@")"
@@ -56,5 +58,7 @@ if [ -n "$naughtyCommits" ]; then
 	echo >&2
 	echo >&2
 	echo >&2 "$naughtyCommits"
 	echo >&2 "$naughtyCommits"
 	echo >&2
 	echo >&2
-	exit 1
+	(( ++numNaughty ))
 fi
 fi
+
+exit "$numNaughty"