Actualiser action.yaml
This commit is contained in:
17
action.yaml
17
action.yaml
@@ -40,12 +40,10 @@ runs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
source "${{ github.action_path }}/bashlib.sh"
|
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 }}"
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user