From 22ab3129494dec5c825a933c4a06973adbc337d4 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Fri, 17 Mar 2023 13:47:37 +0100 Subject: [PATCH] Check stats only if image exists --- .github/workflows/weekly_stats.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/weekly_stats.yaml b/.github/workflows/weekly_stats.yaml index 84c357952..b113f73fe 100644 --- a/.github/workflows/weekly_stats.yaml +++ b/.github/workflows/weekly_stats.yaml @@ -35,7 +35,7 @@ jobs: # shellcheck disable=SC2086 for f in $( find -- * -maxdepth 0 -type d | sort -r ); do DOWNLOADS=0 - if [ -f "$f"/config.json ]; then + if [ -f "$f"/config.json ] && jq -e '.image' "$f/config.json"; then SLUG="$(jq -r '.image' "$f/config.json" | awk -F 'alexbelgium/|-{arch' '{print $2}')" if [[ "$(jq '.arch[]' "$f/config.json")" == *"armv7"* ]]; then ARCH=armv7 && COUNT="$(curl -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')"