Actualiser action.yaml

This commit is contained in:
2025-04-14 09:56:38 +02:00
parent 169d8f5dd4
commit 88c7988b20

View File

@@ -41,11 +41,9 @@ runs:
run: | run: |
source "${{ github.action_path }}/bashlib.sh" source "${{ github.action_path }}/bashlib.sh"
if [[ -z $(which curl) ]] ; then check_command curl
echo -e "${RED}❌ Error:${NC}: Cannot locate the curl command"
exit 1
fi
SERVER="${{ inputs.server }}""
HEALTHPOINT="${{ inputs.server }}/ping/${{ inputs.uuid }}" HEALTHPOINT="${{ inputs.server }}/ping/${{ inputs.uuid }}"
OPTIONS="-fsS -m 10 --retry 5" OPTIONS="-fsS -m 10 --retry 5"
MESSAGE="${{ inputs.message }}" MESSAGE="${{ inputs.message }}"
@@ -65,8 +63,7 @@ runs:
URL="${HEALTHPOINT}" URL="${HEALTHPOINT}"
;; ;;
*) *)
echo "${RED}❌ Error:${NC}: Commande invalide: $COMMAND" error Error "Invalid command: $COMMAND (must be start|log|fail|stop)"
exit 1
;; ;;
esac esac
@@ -77,11 +74,11 @@ runs:
"$URL" "$URL"
) )
echo -e "${YELLOW}🔄 Commande exécutée:${NC} ${curl_cmd[*]}" step "Commande exécutée" "${curl_cmd[*]}"
"${curl_cmd[@]}" \ "${curl_cmd[@]}" \
&& echo -e "${GREEN}✅ Success:${NC} $COMMAND ping sent to ${HEALTHPOINT}" \ && success "Success" "$COMMAND ping sent to ${SERVER}" \
|| echo -e "${RED}❌ Error: ${NC} $COMMAND ping to ${HEALTHPOINT} failed" || error "Error" "$COMMAND ping to ${SERVER} failed"
if [[ "$COMMAND" == "fail" ]] ; then if [[ "$COMMAND" == "fail" ]] ; then
exit 1 exit 1