Actualiser action.yaml

This commit is contained in:
2025-04-14 09:14:50 +02:00
parent d522fe4f68
commit 2022eb6c6b

View File

@@ -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