mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-19 19:18:10 +01:00
43 lines
1.7 KiB
YAML
43 lines
1.7 KiB
YAML
# yamllint disable rule:line-length
|
|
---
|
|
name: Generate README
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "0 0 * * 0"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
crlf_to_lf:
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v3
|
|
- name: Run script file
|
|
run: |
|
|
rm README.md
|
|
cp .README.j2 README.md
|
|
ADDONSLINE=$(sed -n '/%%ADDONS_LIST%%/=' README.md)
|
|
echo "line is $ADDONSLINE"
|
|
sed -i "$ADDONSLINEd" README.md
|
|
for f in *; do
|
|
# $f is an addon directory
|
|
if [ -f "$f"/config.json ]; then
|
|
echo "Project $f"
|
|
[[ $(jq '.arch' "$f/config.json") == *"aarch64"* ]] && sed -i "$ADDONSLINEi ![aarch64][aarch64-badge]" README.md
|
|
[[ $(jq '.arch' "$f/config.json") == *"amd64"* ]] && sed -i "$ADDONSLINEi ![amd64][amd64-badge]" README.md
|
|
[[ $(jq '.arch' "$f/config.json") == *"armv7"* ]] && sed -i "$ADDONSLINEi ![armv7][armv7-badge]" README.md
|
|
[ $(jq '.ingress' "$f/config.json") ] && sed -i "$ADDONSLINEi ![ingress][ingress-badge]" README.md
|
|
[ $(jq '.codenotary' "$f/config.json") ] && sed -i "$ADDONSLINEi ![Signed][signed-badge]" README.md
|
|
[ $(jq '.version' "$f/config.json") ] && sed -i "$ADDONSLINEi ![version][version-badge]" README.md
|
|
sed -i "$ADDONSLINE i [$(jq '.name' $f/config.json)]($f/) : jq '.description' $f/config.json" README.md
|
|
fi
|
|
done
|
|
shell: bash
|
|
- name: Create New Pull Request If Needed
|
|
uses: peter-evans/create-pull-request@v3
|
|
with:
|
|
title: "Github bot : README updated"
|
|
branch-suffix: timestamp
|
|
commit-message: "Github bot : README updated"
|