From 90e726072b4e81c93addd478654382660b1384c1 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sun, 8 May 2022 07:59:54 +0200 Subject: [PATCH] Update daily_README.yaml --- .github/workflows/daily_README.yaml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/daily_README.yaml b/.github/workflows/daily_README.yaml index 8d84b17b7..a81d56674 100644 --- a/.github/workflows/daily_README.yaml +++ b/.github/workflows/daily_README.yaml @@ -46,16 +46,15 @@ jobs: sed -i "/Open Issue :/d" "$f"/README.md # If there is an issue with the addon name in title, put a message - OPENISSUES=$(sed -n "/\"Title\".*$f/I p" issueslist) - if [ "$OPENISSUES" != "" ]; then - while read -r line - do - line=${line#* \"} - line=${line::-2} - sed -i "1i ## Warning! Open Issue : [$line](https://github.com/alexbelgium/hassio-addons/issues?q=is%3Aissue+is%3Aopen+$f)" "$f"/README.md - done <<< "$OPENISSUES" - fi - + mapfile -t arr < <(jq -r 'keys[]' "${issueslist}") + for KEYS in "${arr[0]}"; do + TITLE=$(jq ."$KEYS".[Title] "${issueslist}") + if [[ "$TITLE" == *"$f"* ]]; then + URL=$(jq ."$KEYS".url "${issueslist}") + REQ=$(jq ."$KEYS".user.login "${issueslist}") + sed -i "1i ## Warning! Open Issue : [$TITLE @${REQ}]($URL)" "$f"/README.md + fi + done fi done