[github-actions] Fix issue with hardcoded-images check (#29870)

Signed-off-by: Miguel Ruiz <miguel.ruiz@broadcom.com>
This commit is contained in:
Miguel Ruiz
2024-10-11 10:42:42 +02:00
committed by GitHub
parent fbe886715b
commit bfe0ca8fb6

View File

@@ -111,10 +111,10 @@ jobs:
run: |
hardcoded_images=()
while read -r image; do
if [[ $image != {{*}} ]]; then
if [[ -n "$image" && $image != {{*}} ]]; then
hardcoded_images+=("${image}")
fi
done <<< "$(grep -REoh "^\s*image:\s+[\"']*.+[\"']*\s*$" "charts/bitnami/${CHART}/templates" | sed "s/image: [\"']*//" | sed "s/[\"']*$//")"
done <<< "$(grep -REoh "\s*image:\s+[\"']*.+[\"']*\s*$" "charts/bitnami/${CHART}/templates" | sed "s/image: [\"']*//" | sed "s/[\"']*$//")"
echo "${hardcoded_images[@]}"
if [[ ${#hardcoded_images[@]} -gt 0 ]] ; then