Skip to content

Commit

Permalink
fix date format
Browse files Browse the repository at this point in the history
  • Loading branch information
ikrong committed Jul 1, 2024
1 parent 972b67b commit c2a58d4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions exec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -244,22 +244,23 @@ function status() {
time=${result[1]}
while [ "$status" == "in_progress" ] || [ "$status" == "" ]; do
clear
duration=$(( $(date "+%s") - $(date -u -jf "%Y-%m-%dT%H:%M:%SZ" "$time" "+%s") ))
duration=$( [ "$(uname)" = "Linux" ] && echo "$(date -d "$time" "+%s")" || echo "$(date -u -jf "%Y-%m-%dT%H:%M:%SZ" "$time" "+%s")" )
duration=$(( $(date "+%s") - $duration ))
if [ $duration -ge 3600 ]; then
duration="$((duration/60))min"
else
duration="${duration}s"
fi
echo "Workflow $(g $WORKFLOW) RunID: $(b $RUN_ID) $(g $status) $duration"
echo "Open https://github.com/$REPO/actions/runs/$RUN_ID to see log"
sleep 20
sleep 5
result=($(echo $status_cmd | sh))
echo ${result[0]}
status=${result[0]}
done
clear
echo "Workflow $(g $WORKFLOW) has finished with status: $(g $status)"
if [ "$CMD" = "trigger" ]; then
if [[ "$CMD" = "trigger" || "$CMD" = "copy" || "$CMD" = "sync" ]]; then
format_config $status >> run.log
fi
echo "Open https://github.com/$REPO/actions/runs/$RUN_ID to see log"
Expand Down

0 comments on commit c2a58d4

Please sign in to comment.