From ca3eb9f6f6ee0928c98208af71e8ffcf01d4ed2d Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Sat, 5 Apr 2025 21:12:55 +0200 Subject: [PATCH] Actualiser .gitea/workflows/check-release.yaml --- .gitea/workflows/check-release.yaml | 30 ++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/check-release.yaml b/.gitea/workflows/check-release.yaml index 0fd58e6..6946da8 100644 --- a/.gitea/workflows/check-release.yaml +++ b/.gitea/workflows/check-release.yaml @@ -11,12 +11,32 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - - name: Retrieve Calibre-web version + - name: Retrieve latest Calibre-web version run: | + mkdir -p /tmp curl -s https://api.github.com/repos/janeczku/calibre-web/releases/latest \ - | jq -r .tag_name > calibre_web_latest.txt + | jq -r .tag_name > /tmp/calibre_web_latest.txt + if diff calibre_web_latest.txt /tmp/calibre_web_latest.txt ; then + mv /tmp/calibre_web_latest.txt calibre_web_latest.txt + + fi shell: bash - - name: Send version to Haoma + + - name: Check if version changed + uses: stefanzweifel/git-auto-commit-action@v5 + id: auto-commit-action + + - name: Send new version to Haoma + if: steps.auto-commit-action.outputs.changes_detected == 'true' run: | - curl -fsS -m 10 --retry 5 --data-binary @calibre_web_latest.txt \ - 'https://haoma.petite-maison-orange.fr/ping/933b9d63-37e1-42a7-9681-241af9c582f1' + curl -fsS -m 10 --retry 5 \ + --data-raw "New version avalaible $(cat calibre_web_latest.txt)" \ + 'https://haoma.petite-maison-orange.fr/ping/933b9d63-37e1-42a7-9681-241af9c582f1' + shell: bash + - name: Send no version to Haoma + if: steps.auto-commit-action.outputs.changes_detected == 'true' + run: | + curl -fsS -m 10 --retry 5 \ + --data-raw "No version avalaible stay on $(cat calibre_web_latest.txt)" \ + 'https://haoma.petite-maison-orange.fr/ping/933b9d63-37e1-42a7-9681-241af9c582f1' + shell: bash