mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-18 10:28:17 +01:00
Update daily_README.yaml
This commit is contained in:
22
.github/workflows/daily_README.yaml
vendored
22
.github/workflows/daily_README.yaml
vendored
@@ -15,10 +15,24 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
- name: Run script file
|
||||
run: |
|
||||
# Init
|
||||
echo "Starting"
|
||||
|
||||
# Prepare template
|
||||
cp .templates/.README.md README2.md
|
||||
ADDONSLINE=$(sed -n '/%%ADDONS_LIST%%/=' README2.md)
|
||||
sed -i "/**ADDONS_LIST%%/d" README2.md
|
||||
|
||||
# Sort folders by addon name
|
||||
for f in $( find -- * -type d | sort -r ); do
|
||||
if [ -f "$f"/config.json ]; then
|
||||
echo "$f" > "$f"/oldname
|
||||
NAME=$(jq -r '.name' "$f"/config.json)
|
||||
mv "$f" "NAME"
|
||||
fi
|
||||
done
|
||||
|
||||
# Populate template
|
||||
for f in $( find -- * -type d | sort -r ); do
|
||||
# $f is an addon directory
|
||||
if [ -f "$f"/config.json ]; then
|
||||
@@ -38,6 +52,14 @@ jobs:
|
||||
sed -i "$ADDONSLINE"'a ✓ ['"$NAME"']('"$f"'/) : '"$DESCRIPTION\\n" README2.md
|
||||
fi
|
||||
done
|
||||
|
||||
# Restore folders name
|
||||
for f in $( find -- * -type d | sort -r ); do
|
||||
if [ -f "$f"/config.json ]; then
|
||||
mv "$f" "$(cat "$f"/oldname)
|
||||
fi
|
||||
done
|
||||
|
||||
# Replace template if change
|
||||
if [[ "$(stat -c%s "README2.md")" == "$(stat -c%s "README.md")" ]]; then
|
||||
echo "no changes"
|
||||
|
||||
Reference in New Issue
Block a user