Actualiser action.yaml

This commit is contained in:
2025-04-13 23:44:53 +02:00
parent e69f933a8c
commit 23113678a0

View File

@@ -12,7 +12,7 @@ inputs:
command: command:
description: 'Command to sen to the server can be nothing, start, log or fail' description: 'Command to sen to the server can be nothing, start, log or fail'
required: false required: false
default: '' default: 'stop'
message: message:
description: 'Message to log with the ping' description: 'Message to log with the ping'
required: false required: false
@@ -29,13 +29,10 @@ runs:
OPTIONS="-fsS -m 10 --retry 5" OPTIONS="-fsS -m 10 --retry 5"
MESSAGE="${{ inputs.message }}" MESSAGE="${{ inputs.message }}"
COMMAND="${{ input.command }}" COMMAND="${{ input.command }}"
if [[ -n "$MESSAGE" ]] ; then if [[ -n "$MESSAGE" ]] ; then
MESSAGE="--data-raw \"${MESSAGE}\"" MESSAGE="--data-raw \"${MESSAGE}\""
fi fi
case "$COMMAND" in case "$COMMAND" in
start | log | fail) start | log | fail)
URL="${HEALTHPOINT}/$COMMAND" URL="${HEALTHPOINT}/$COMMAND"
;; ;;
@@ -44,14 +41,11 @@ runs:
URL="${HEALTHPOINT}" URL="${HEALTHPOINT}"
;; ;;
esac esac
RUN="curl $OPTIONS $MESSAGE '$URL'" RUN="curl $OPTIONS $MESSAGE '$URL'"
eval "$RUN" eval "$RUN"
if [[ "$COMMAND"=="fail" ]] ; then if [[ "$COMMAND"=="fail" ]] ; then
exit 1 exit 1
fi fi
exit 0 exit 0