Use latest

This commit is contained in:
Alexandre
2025-05-08 14:46:11 +01:00
committed by GitHub
parent a3ac4cadca
commit 5cacb7d9d0
4 changed files with 13 additions and 13 deletions

View File

@@ -8,7 +8,7 @@ on:
jobs:
README_updater:
if: github.repository_owner == 'alexbelgium'
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
@@ -37,7 +37,7 @@ jobs:
mv "$f" "$NAME"
fi
fi
done
done
# Populate template
@@ -45,19 +45,19 @@ jobs:
find -- * -maxdepth 0 -type d | sort -r | while read -r f; do
# $f is an addon directory
if [ -f "$f/config.json" ]; then
echo "Project $f"
# Get variables
if [ -f "$f/oldname" ]; then FOLDERNAME="$(cat "$f/oldname")"; else FOLDERNAME="$f"; fi
NAME="$(jq -r '.name' "$f/config.json")"
DESCRIPTION="$(jq -r '.description' "$f/config.json")"
# Get icon
if [ "$(jq '.panel_icon' "$f/config.json")" != null ]; then
if [ "$(jq '.panel_icon' "$f/config.json")" != null ]; then
ICON="$(jq -r '.panel_icon' "$f/config.json")"
ICON="${ICON#*:}"
ICON="![image](https://api.iconify.design/mdi/$ICON.svg)"
else
else
ICON=""
fi
@@ -73,10 +73,10 @@ jobs:
if [[ "$(jq '.arch[]' "$f/config.json")" == *"armv7"* ]]; then
sed -i "$ADDONSLINE"'a ![armv7][armv7-badge]' README2.md
else sed -i "$ADDONSLINE"'a ![armv7no][armv7no-badge]' README2.md; fi || true
if [[ "$(jq '.arch[]' "$f/config.json")" == *"amd64"* ]]; then
if [[ "$(jq '.arch[]' "$f/config.json")" == *"amd64"* ]]; then
sed -i "$ADDONSLINE"'a ![amd64][amd64-badge]' README2.md
else sed -i "$ADDONSLINE"'a ![amd64no][amd64no-badge]' README2.md; fi || true
if [[ "$(jq '.arch[]' "$f/config.json")" == *"aarch64"* ]]; then
if [[ "$(jq '.arch[]' "$f/config.json")" == *"aarch64"* ]]; then
sed -i "$ADDONSLINE"'a ![aarch64][aarch64-badge]' README2.md
else sed -i "$ADDONSLINE"'a ![aarch64no][aarch64no-badge]' README2.md; fi || true
if [[ -f "$f/updater.json" ]]; then sed -i "$ADDONSLINE"'a ![Update](https://img.shields.io/badge/dynamic/json?label=Updated&query=%24.last_update&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2F'"$FOLDERNAME"'%2Fupdater.json)' README2.md; fi

View File

@@ -9,7 +9,7 @@ on:
jobs:
ISSUES_linked:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

View File

@@ -10,7 +10,7 @@ on:
jobs:
sort_json:
if: github.repository_owner == 'alexbelgium'
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

View File

@@ -9,7 +9,7 @@ on:
jobs:
stats_updater:
if: github.repository_owner == 'alexbelgium'
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
@@ -45,14 +45,14 @@ jobs:
COUNT1="$COUNT"
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))"
else COUNT1="-"; fi
if [[ "$(jq '.arch[]' "$f/config.json")" == *"amd64"* ]]; then
if [[ "$(jq '.arch[]' "$f/config.json")" == *"amd64"* ]]; then
ARCH=amd64 && COUNT="$(curl --connect-timeout 5 -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')"
until [ -n "$COUNT" ]; do COUNT="$(curl --connect-timeout 5 -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; ((c++)) && echo "repeat $c" && if [[ "$c" == 10 ]]; then count=0; fi; done
COUNT="${COUNT//,/}"
COUNT2="$COUNT"
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))"
else COUNT2="-"; fi
if [[ "$(jq '.arch[]' "$f/config.json")" == *"aarch64"* ]]; then
if [[ "$(jq '.arch[]' "$f/config.json")" == *"aarch64"* ]]; then
ARCH=aarch64 && COUNT="$(curl --connect-timeout 5 -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')"
until [ -n "$COUNT" ]; do COUNT="$(curl --connect-timeout 5 -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; ((c++)) && echo "repeat $c" && if [[ "$c" == 10 ]]; then count=0; fi; done
COUNT="${COUNT//,/}"