Skip to content

Commit

Permalink
feat: show status and run time for workflow job complete
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhongit committed May 10, 2024
1 parent e5af940 commit c8d8fb2
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@
$icon = '🚫';
$last = '';
}
$startedAt = new DateTime($payload->workflow_job->started_at);
$completedAt = new DateTime($payload->workflow_job->completed_at);
$interval = $completedAt->diff($startedAt);
$allSeconds = $interval->s + $interval->i * 60 + $interval->h * 3600;
?>

{{ $icon }} {!! __("tg-notifier::events/github/workflow_job.completed.$status", ['repo' => "🦑<a href='{$payload->repository->html_url}'>{$payload->repository->full_name}</a>"]) !!}

🚀 {!! __('tg-notifier::events/github/workflow_job.name') !!}: {{ $icon }} <code>{{ $payload->workflow_job->name }}</code> {{ $last }}
🚨 {!! __('tg-notifier::events/github/workflow_job.status.title') !!}: {!! __('tg-notifier::events/github/workflow_job.status.'.$status) !!}
🚨 {!! __('tg-notifier::events/github/workflow_job.status.title') !!}: <code>{!! __('tg-notifier::events/github/workflow_job.status.'.$status) !!}</code> 🕓 <code>{{ $allSeconds }}s</code>
🔗 {!! __('tg-notifier::events/github/workflow_job.link', ['link' => "<a href='{$payload->workflow_job->html_url}'>{$payload->workflow_job->workflow_name}</a>"]) !!}

0 comments on commit c8d8fb2

Please sign in to comment.