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