mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-17 18:08:16 +01:00
Update daily_README.yaml
This commit is contained in:
15
.github/workflows/daily_README.yaml
vendored
15
.github/workflows/daily_README.yaml
vendored
@@ -18,7 +18,7 @@ jobs:
|
||||
|
||||
declare -i DOWNLOADS
|
||||
declare -i COUNT
|
||||
TOTALUSERS=0
|
||||
echo "" > Stats.md
|
||||
|
||||
# Go through all folders, add to filters if not existing
|
||||
for f in $( find -- * -maxdepth 0 -type d | sort -r ); do
|
||||
@@ -108,29 +108,30 @@ jobs:
|
||||
sed -i "$ADDONSLINE"'a ![armv7][armv7-badge]' README2.md
|
||||
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}')"
|
||||
if [ -z "$COUNT" ]; then echo "$(curl -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}')"; fi
|
||||
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))" && TOTALUSERS="$(( TOTALUSERS + DOWNLOADS))"
|
||||
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))"
|
||||
else sed -i "$ADDONSLINE"'a ![armv7no][armv7no-badge]' README2.md; fi || true
|
||||
if [[ $(jq '.arch[]' "$f/config.json") == *"amd64"* ]]; then
|
||||
sed -i "$ADDONSLINE"'a ![amd64][amd64-badge]' README2.md
|
||||
ARCH=amd64 && 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}')"
|
||||
until [ ! -z "$COUNT" ]; do 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}')" && sleep 5; done
|
||||
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))" && TOTALUSERS="$(( TOTALUSERS + DOWNLOADS))"
|
||||
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))"
|
||||
else sed -i "$ADDONSLINE"'a ![amd64no][amd64no-badge]' README2.md; fi || true
|
||||
if [[ $(jq '.arch[]' "$f/config.json") == *"aarch64"* ]]; then
|
||||
sed -i "$ADDONSLINE"'a ![aarch64][aarch64-badge]' README2.md
|
||||
ARCH=aarch64 && 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}')"
|
||||
if [ -z "$COUNT" ]; then echo "$(curl -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}')"; fi
|
||||
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))" && TOTALUSERS="$(( TOTALUSERS + DOWNLOADS))"
|
||||
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))"
|
||||
else sed -i "$ADDONSLINE"'a ![aarch64no][aarch64no-badge]' README2.md; fi || true
|
||||
if [[ -f "$f/updater.json" ]]; then sed -i "$ADDONSLINE"'a ' README2.md; fi
|
||||
sed -i "$ADDONSLINE"'a   ' README2.md || true
|
||||
sed -i "$ADDONSLINE"'a ✓ '"$ICON"' ['"$NAME"']('"$FOLDERNAME"'/) : '"$DESCRIPTION ($DOWNLOADS users)\\n" README2.md
|
||||
sed -i "$ADDONSLINE"'a ✓ '"$ICON"' ['"$NAME"']('"$FOLDERNAME"'/) : '"$DESCRIPTION\\n" README2.md
|
||||
echo "$SLUG $DOWNLOADS" >> Stats.md
|
||||
fi
|
||||
done
|
||||
|
||||
# Total users
|
||||
# Sort file
|
||||
|
||||
sed -i "s|## Add-ons provided by this repository|## Add-ons provided by this repository ($TOTALUSERS addons being used)|g" README2.md
|
||||
sort -k 1 Stats.md
|
||||
|
||||
# Restore folders name
|
||||
|
||||
|
||||
Reference in New Issue
Block a user