From 2022eb6c6b6451c70fc155964c82393a72c138d0 Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Mon, 14 Apr 2025 09:14:50 +0200 Subject: [PATCH] Actualiser action.yaml --- action.yaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/action.yaml b/action.yaml index b80a4d3..8fc76e1 100644 --- a/action.yaml +++ b/action.yaml @@ -25,6 +25,15 @@ runs: - name: Ping the server shell: bash run: | + GREEN='\033[0;32m' + RED='\033[0;31m' + NC='\033[0m' # No Color + + if [[ -z $(which curl) ]] ; then + echo -e "${RED}❌ Error:${NC}: Cannot locate the curl command" + exit 1 + fi + HEALTHPOINT="${{ inputs.server }}/ping/${{ inputs.uuid }}" OPTIONS="-fsS -m 10 --retry 5" MESSAGE="${{ inputs.message }}" @@ -44,7 +53,7 @@ runs: URL="${HEALTHPOINT}" ;; *) - echo "::error::Commande invalide: $COMMAND" + echo "${RED}❌ Error:${NC}: Commande invalide: $COMMAND" exit 1 ;; esac @@ -58,7 +67,9 @@ runs: echo "Commande exécutée: ${curl_cmd[*]}" - "${curl_cmd[@]}" # Exécution sans eval + "${curl_cmd[@]}" \ + && echo -e "${GREEN}✅ Success:${NC} ping sent to ${HEALTHPOINT}" \ + || echo -e "${RED}❌ Error: ${NC} ping to ${HEALTHPOINT} failed" if [[ "$COMMAND" == "fail" ]] ; then exit 1