diff --git a/lang/en/events/github/issue_comment.php b/lang/en/events/github/issue_comment.php new file mode 100644 index 0000000..5f972d7 --- /dev/null +++ b/lang/en/events/github/issue_comment.php @@ -0,0 +1,14 @@ +<?php + +return [ + 'issue_comment_title' => 'š¢', + 'created' => [ + 'title' => 'š¬ <b>New Issue Comment</b> ā ļø to š¦ :issue by :user', + ], + 'deleted' => [ + 'title' => 'š <b>Issue Comment Deleted</b> š¬ from š¦ :issue by :user', + ], + 'edited' => [ + 'title' => 'š <b>Issue Comment Edited</b> š¬ in š¦ :issue by :user', + ], +]; diff --git a/lang/en/events/github/issues.php b/lang/en/events/github/issues.php index ac99d7b..87cff4a 100644 --- a/lang/en/events/github/issues.php +++ b/lang/en/events/github/issues.php @@ -5,4 +5,39 @@ 'closed' => [ 'title' => 'š« <b>Issue Closed </b> to š¦ :issue by :user', ], + 'deleted' => [ + 'title' => 'š <b>Issue Deleted</b> form š¦ :issue by :user', + ], + 'edited' => [ + 'title' => 'ā ļø <b>Issue has been edited</b> to š¦ :issue by :user', + 'changes' => [ + 'title' => [ + 'name' => 'š <b>Title</b> has been changed', + 'from' => 'š <b>From:</b> :title_from', + 'to' => 'š· <b>To:</b> :title_to', + ], + 'body' => [ + 'title' => 'š <b>Body</b> has been changed', + 'message' => 'Please check the issue for more details', + ], + ], + ], + 'locked' => [ + 'title' => 'š <b>Issue Locked</b> form š¦ :issue by :user', + ], + 'opened' => [ + 'title' => 'ā ļø <b>New Issue</b> to š¦ :issue by :user', + ], + 'pinned' => [ + 'title' => 'š <b>Issue Pinned</b> form š¦ :issue by :user', + ], + 'reopened' => [ + 'title' => 'ā ļø <b>Issue has been reopened</b> ā ļø to š¦ :issue by :user', + ], + 'unlocked' => [ + 'title' => 'š <b>Issue Unlocked</b> form š¦ :issue by :user', + ], + 'unpinned' => [ + 'title' => 'š <b>Issue Unpinned</b> form š¦ :issue by :user', + ], ]; diff --git a/lang/en/events/github/ping.php b/lang/en/events/github/ping.php new file mode 100644 index 0000000..7d9d2b9 --- /dev/null +++ b/lang/en/events/github/ping.php @@ -0,0 +1,10 @@ +<?php + +return [ + 'default' => [ + 'title' => 'ā»ļø <b>Connection Successful</b>', + 'organization' => 'š¢ Organization: <b>:organization</b>', + 'full_name' => 'š¦ Repository: š¦<b>:full_name</b>', + 'sender' => 'š¤ Sender (triggered the event): <b>:sender</b>', + ], +]; diff --git a/lang/en/events/github/pull_request.php b/lang/en/events/github/pull_request.php new file mode 100644 index 0000000..8fdcf31 --- /dev/null +++ b/lang/en/events/github/pull_request.php @@ -0,0 +1,16 @@ +<?php + +return [ + 'review' => 'š„ Reviewers: ', + 'closed' => [ + 'title' => ':title - š¦:issue by :user', + 'title_merged' => 'ā <b>Pull Request Merged</b>', + 'title_closed' => 'ā <b>Pull Request Closed</b>', + ], + 'opened' => [ + 'title' => 'š·āāļøš ļø <b>New Pull Request</b> - š¦:issue by :user', + ], + 'reopened' => [ + 'title' => 'š·āāļøš ļø <b>Reopened Pull Request</b> - š¦:issue by :user', + ], +]; diff --git a/lang/en/events/shared/github.php b/lang/en/events/shared/github.php index 782d6b6..ce3f29f 100644 --- a/lang/en/events/shared/github.php +++ b/lang/en/events/shared/github.php @@ -4,4 +4,7 @@ '_body' => [ 'title' => 'š <b>Content:</b>', ], + '_assignee' => [ + 'title' => 'š Assignee: ', + ], ]; diff --git a/resources/views/events/github/issue_comment/created.blade.php b/resources/views/events/github/issue_comment/created.blade.php new file mode 100644 index 0000000..604759a --- /dev/null +++ b/resources/views/events/github/issue_comment/created.blade.php @@ -0,0 +1,20 @@ +<?php +/** + * @var $payload mixed + * @var $event string + */ + +$issue = $payload->issue; +?> + +{!! __('tg-notifier::events/github/issue_comment.created.title', [ + 'issue' => "<a href='$issue->html_url'>{$payload->repository->full_name}#$issue->number</a>", + 'user' => "<a href='{$issue->user->html_url}'>@{$issue->user->login}</a>" + ] + ) !!} + +š¢ <b>{{ $issue->title }}</b> + +@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) + +@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event')) diff --git a/resources/views/events/github/issue_comment/deleted.blade.php b/resources/views/events/github/issue_comment/deleted.blade.php new file mode 100644 index 0000000..52e8ebe --- /dev/null +++ b/resources/views/events/github/issue_comment/deleted.blade.php @@ -0,0 +1,20 @@ +<?php +/** + * @var $payload mixed + * @var $event string + */ + +$issue = $payload->issue; +?> + +{!! __('tg-notifier::events/github/issue_comment.deleted.title', [ + 'issue' => "<a href='$issue->html_url'>{$payload->repository->full_name}#$issue->number</a>", + 'user' => "<a href='{$issue->user->html_url}'>@{$issue->user->login}</a>" + ] + ) !!} + +š¢ <b>{{ $issue->title }}</b> + +@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) + +@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event')) diff --git a/resources/views/events/github/issue_comment/edited.blade.php b/resources/views/events/github/issue_comment/edited.blade.php new file mode 100644 index 0000000..c1c1c0e --- /dev/null +++ b/resources/views/events/github/issue_comment/edited.blade.php @@ -0,0 +1,20 @@ +<?php +/** + * @var $payload mixed + * @var $event string + */ + +$issue = $payload->issue; +?> + +{!! __('tg-notifier::events/github/issue_comment.edited.title', [ + 'issue' => "<a href='$issue->html_url'>{$payload->repository->full_name}#$issue->number</a>", + 'user' => "<a href='{$issue->user->html_url}'>@{$issue->user->login}</a>" + ] + ) !!} + +š¢ <b>{{ $issue->title }}</b> + +@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) + +@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event')) diff --git a/resources/views/events/github/issues/closed.blade.php b/resources/views/events/github/issues/closed.blade.php index 7f20b3d..5940c15 100644 --- a/resources/views/events/github/issues/closed.blade.php +++ b/resources/views/events/github/issues/closed.blade.php @@ -13,7 +13,7 @@ ] ) !!} -{!! __('tg-notifier::events/github/issues.issue_title') !!} <b><?= $issue->title; ?></b> +š¢ <b>{{ $issue->title }}</b> @include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) diff --git a/resources/views/events/github/issues/deleted.blade.php b/resources/views/events/github/issues/deleted.blade.php new file mode 100644 index 0000000..b0dde6b --- /dev/null +++ b/resources/views/events/github/issues/deleted.blade.php @@ -0,0 +1,20 @@ +<?php +/** + * @var $payload mixed + * @var $event string + */ + +$issue = $payload->issue; +?> + +{!! __('tg-notifier::events/github/issues.deleted.title', [ + 'issue' => "<a href='$issue->html_url'>{$payload->repository->full_name}#$issue->number</a>", + 'user' => "<a href='{$issue->user->html_url}'>@{$issue->user->login}</a>" + ] + ) !!} + +š¢ <b>{{ $issue->title }}</b> + +@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) + +@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event')) diff --git a/resources/views/events/github/issues/edited.blade.php b/resources/views/events/github/issues/edited.blade.php new file mode 100644 index 0000000..b487dd5 --- /dev/null +++ b/resources/views/events/github/issues/edited.blade.php @@ -0,0 +1,26 @@ +<?php +/** + * @var $payload mixed + * @var $event string + */ + +$issue = $payload->issue; +?> + +{!! __('tg-notifier::events/github/issues.edited.title', [ + 'issue' => "<a href='$issue->html_url'>{$payload->repository->full_name}#$issue->number</a>", + 'user' => "<a href='{$issue->user->html_url}'>@{$issue->user->login}</a>" + ] + ) !!} + +š¢ <b>{{ $issue->title }}</b> + +@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) +@if(isset($payload->changes->title)) +{!! __('tg-notifier::events/github/issues.edited.changes.title.name') !!} + {!! __('tg-notifier::events/github/issues.edited.changes.title.from', ['title_from' => $payload->changes->title->from]) !!} + {!! __('tg-notifier::events/github/issues.edited.changes.title.to', ['title_to' => $payload->issue->title]) !!} +@elseif(isset($payload->changes->body)) +{!! __('tg-notifier::events/github/issues.edited.changes.body.title') !!} +{!! __('tg-notifier::events/github/issues.edited.changes.body.message') !!} +@endif diff --git a/resources/views/events/github/issues/locked.blade.php b/resources/views/events/github/issues/locked.blade.php new file mode 100644 index 0000000..3d521de --- /dev/null +++ b/resources/views/events/github/issues/locked.blade.php @@ -0,0 +1,20 @@ +<?php +/** + * @var $payload mixed + * @var $event string + */ + +$issue = $payload->issue; +?> + +{!! __('tg-notifier::events/github/issues.locked.title', [ + 'issue' => "<a href='$issue->html_url'>{$payload->repository->full_name}#$issue->number</a>", + 'user' => "<a href='{$issue->user->html_url}'>@{$issue->user->login}</a>" + ] + ) !!} + +š¢ <b>{{ $issue->title }}</b> + +@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) + +@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event')) diff --git a/resources/views/events/github/issues/opened.blade.php b/resources/views/events/github/issues/opened.blade.php new file mode 100644 index 0000000..bad7aa2 --- /dev/null +++ b/resources/views/events/github/issues/opened.blade.php @@ -0,0 +1,20 @@ +<?php +/** + * @var $payload mixed + * @var $event string + */ + +$issue = $payload->issue; +?> + +{!! __('tg-notifier::events/github/issues.opened.title', [ + 'issue' => "<a href='$issue->html_url'>{$payload->repository->full_name}#$issue->number</a>", + 'user' => "<a href='{$issue->user->html_url}'>@{$issue->user->login}</a>" + ] + ) !!} + +š¢ <b>{{ $issue->title }}</b> + +@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) + +@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event')) diff --git a/resources/views/events/github/issues/pinned.blade.php b/resources/views/events/github/issues/pinned.blade.php new file mode 100644 index 0000000..f431c3b --- /dev/null +++ b/resources/views/events/github/issues/pinned.blade.php @@ -0,0 +1,20 @@ +<?php +/** + * @var $payload mixed + * @var $event string + */ + +$issue = $payload->issue; +?> + +{!! __('tg-notifier::events/github/issues.pinned.title', [ + 'issue' => "<a href='$issue->html_url'>{$payload->repository->full_name}#$issue->number</a>", + 'user' => "<a href='{$issue->user->html_url}'>@{$issue->user->login}</a>" + ] + ) !!} + +š¢ <b>{{ $issue->title }}</b> + +@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) + +@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event')) diff --git a/resources/views/events/github/issues/reopened.blade.php b/resources/views/events/github/issues/reopened.blade.php new file mode 100644 index 0000000..629c01a --- /dev/null +++ b/resources/views/events/github/issues/reopened.blade.php @@ -0,0 +1,20 @@ +<?php +/** + * @var $payload mixed + * @var $event string + */ + +$issue = $payload->issue; +?> + +{!! __('tg-notifier::events/github/issues.reopened.title', [ + 'issue' => "<a href='$issue->html_url'>{$payload->repository->full_name}#$issue->number</a>", + 'user' => "<a href='{$issue->user->html_url}'>@{$issue->user->login}</a>" + ] + ) !!} + +š¢ <b>{{ $issue->title }}</b> + +@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) + +@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event')) diff --git a/resources/views/events/github/issues/unlocked.blade.php b/resources/views/events/github/issues/unlocked.blade.php new file mode 100644 index 0000000..11f2da9 --- /dev/null +++ b/resources/views/events/github/issues/unlocked.blade.php @@ -0,0 +1,20 @@ +<?php +/** + * @var $payload mixed + * @var $event string + */ + +$issue = $payload->issue; +?> + +{!! __('tg-notifier::events/github/issues.unlocked.title', [ + 'issue' => "<a href='$issue->html_url'>{$payload->repository->full_name}#$issue->number</a>", + 'user' => "<a href='{$issue->user->html_url}'>@{$issue->user->login}</a>" + ] + ) !!} + +š¢ <b>{{ $issue->title }}</b> + +@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) + +@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event')) diff --git a/resources/views/events/github/issues/unpinned.blade.php b/resources/views/events/github/issues/unpinned.blade.php new file mode 100644 index 0000000..e2bbc83 --- /dev/null +++ b/resources/views/events/github/issues/unpinned.blade.php @@ -0,0 +1,20 @@ +<?php +/** + * @var $payload mixed + * @var $event string + */ + +$issue = $payload->issue; +?> + +{!! __('tg-notifier::events/github/issues.unpinned.title', [ + 'issue' => "<a href='$issue->html_url'>{$payload->repository->full_name}#$issue->number</a>", + 'user' => "<a href='{$issue->user->html_url}'>@{$issue->user->login}</a>" + ] + ) !!} + +š¢ <b>{{ $issue->title }}</b> + +@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) + +@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event')) diff --git a/resources/views/events/github/ping/default.blade.php b/resources/views/events/github/ping/default.blade.php new file mode 100644 index 0000000..181ee15 --- /dev/null +++ b/resources/views/events/github/ping/default.blade.php @@ -0,0 +1,17 @@ +<?php +/** + * @var $payload mixed + */ +?> + +{!! __('tg-notifier::events/github/ping.default.title') !!} + +@if(isset($payload->organization)) +{!! __('tg-notifier::events/github/ping.default.organization', ['organization' => $payload->organization->login]) !!} +@endif +@if(isset($payload->repository)) +{!! __('tg-notifier::events/github/ping.default.full_name', ['full_name' => $payload->repository->full_name]) !!} +@endif +@if(isset($payload->sender)) +{!! __('tg-notifier::events/github/ping.default.sender', ['sender' => $payload->sender->login]) !!} +@endif diff --git a/resources/views/events/github/pull_request/closed.blade.php b/resources/views/events/github/pull_request/closed.blade.php new file mode 100644 index 0000000..59722ab --- /dev/null +++ b/resources/views/events/github/pull_request/closed.blade.php @@ -0,0 +1,29 @@ +<?php +/** + * @var $payload mixed + * @var $event string + */ + +$pull_request = $payload->pull_request; + +$message = __('tg-notifier::events/github/pull_request.closed.title_merged'); +if (!isset($payload->pull_request->merged) || $payload->pull_request->merged !== true) { + $message = __('tg-notifier::events/github/pull_request.closed.title_closed'); +} +?> + +{!! __('tg-notifier::events/github/pull_request.closed.title', [ + 'title' => $message, + 'issue' => "<a href='$pull_request->html_url'>{$payload->repository->full_name}#$pull_request->number</a>", + 'user' => "<a href='{$pull_request->user->html_url}'>@{$pull_request->user->login}</a>" + ] + ) !!} + +š¢ <b>{{ $pull_request->title }}</b> + +š³ {{ $pull_request->head->ref }} -> {{ $pull_request->base->ref }} šÆ +@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) + +@include('tg-notifier::events.github.pull_request.partials._reviewers', compact('payload')) + +@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event')) diff --git a/resources/views/events/github/pull_request/opened.blade.php b/resources/views/events/github/pull_request/opened.blade.php new file mode 100644 index 0000000..9114c83 --- /dev/null +++ b/resources/views/events/github/pull_request/opened.blade.php @@ -0,0 +1,23 @@ +<?php +/** + * @var $payload mixed + * @var $event string + */ + +$pull_request = $payload->pull_request; +?> + +{!! __('tg-notifier::events/github/pull_request.opened.title', [ + 'issue' => "<a href='$pull_request->html_url'>{$payload->repository->full_name}#$pull_request->number</a>", + 'user' => "<a href='{$pull_request->user->html_url}'>@{$pull_request->user->login}</a>" + ] + ) !!} + +š¢ <b>{{ $pull_request->title }}</b> + +š³ {{ $pull_request->head->ref }} -> {{ $pull_request->base->ref }} šÆ +@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) + +@include('tg-notifier::events.github.pull_request.partials._reviewers', compact('payload')) + +@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event')) diff --git a/resources/views/events/github/pull_request/partials/_reviewers.blade.php b/resources/views/events/github/pull_request/partials/_reviewers.blade.php new file mode 100644 index 0000000..78dbe1e --- /dev/null +++ b/resources/views/events/github/pull_request/partials/_reviewers.blade.php @@ -0,0 +1,16 @@ +<?php +/** + * @var $payload mixed + */ + +$textReviewers = ''; +if (isset($payload->pull_request->requested_reviewers) && count($payload->pull_request->requested_reviewers) > 0) { + $reviewers = []; + foreach ($payload->pull_request->requested_reviewers as $reviewer) { + $reviewers[] = "<b>{$reviewer->login}</b>"; + } + + $textReviewers .= __('tg-notifier::events/github/pull_request.review') . implode(', ', $reviewers); +} +?> +{!! $textReviewers !!} diff --git a/resources/views/events/github/pull_request/reopened.blade.php b/resources/views/events/github/pull_request/reopened.blade.php new file mode 100644 index 0000000..5567a00 --- /dev/null +++ b/resources/views/events/github/pull_request/reopened.blade.php @@ -0,0 +1,23 @@ +<?php +/** + * @var $payload mixed + * @var $event string + */ + +$pull_request = $payload->pull_request; +?> + +{!! __('tg-notifier::events/github/pull_request.reopened.title', [ + 'issue' => "<a href='$pull_request->html_url'>{$payload->repository->full_name}#$pull_request->number</a>", + 'user' => "<a href='{$pull_request->user->html_url}'>@{$pull_request->user->login}</a>" + ] + ) !!} + +š¢ <b>{{ $pull_request->title }}</b> + +š³ {{ $pull_request->head->ref }} -> {{ $pull_request->base->ref }} šÆ +@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) + +@include('tg-notifier::events.github.pull_request.partials._reviewers', compact('payload')) + +@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event')) diff --git a/resources/views/events/github/pull_request_review/dismissed.blade.php b/resources/views/events/github/pull_request_review/dismissed.blade.php new file mode 100644 index 0000000..0235a06 --- /dev/null +++ b/resources/views/events/github/pull_request_review/dismissed.blade.php @@ -0,0 +1,12 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "š·āāļøš ļø <b>Dismissed Pull Request Review Comment</b> š¬ - š¦<a href=\"{$payload->pull_request->html_url}\">{$payload->repository->full_name}#{$payload->pull_request->number}</a> by <a href=\"{$payload->review->user->html_url}\">@{$payload->review->user->login}</a>\n\n"; + +$message .= "š <b>{$payload->pull_request->title}</b> \n\n"; + +$message .= "š Link: <a href=\"{$payload->review->html_url}\">{$payload->review->html_url}</a>\n\n"; + +echo $message; diff --git a/resources/views/events/github/pull_request_review/submitted.blade.php b/resources/views/events/github/pull_request_review/submitted.blade.php new file mode 100644 index 0000000..2fed0b9 --- /dev/null +++ b/resources/views/events/github/pull_request_review/submitted.blade.php @@ -0,0 +1,12 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "š·āāļøš ļø <b>New Pull Request Review Comment</b> š¬ - š¦<a href=\"{$payload->pull_request->html_url}\">{$payload->repository->full_name}#{$payload->pull_request->number}</a> by <a href=\"{$payload->review->user->html_url}\">@{$payload->review->user->login}</a>\n\n"; + +$message .= "š <b>{$payload->pull_request->title}</b> \n\n"; + +$message .= "š Link: <a href=\"{$payload->review->html_url}\">{$payload->review->html_url}</a>\n\n"; + +echo $message; diff --git a/resources/views/events/github/push/default.blade.php b/resources/views/events/github/push/default.blade.php new file mode 100644 index 0000000..7ee9595 --- /dev/null +++ b/resources/views/events/github/push/default.blade.php @@ -0,0 +1,21 @@ +<?php +/** + * @var $payload mixed + */ + +$count = count($payload->commits); +$noun = ($count > 1) ? "commits" : "commit"; + +$ref = explode('/', $payload->ref); +$branch = implode('/', array_slice($ref, 2)); + +$message = "āļø <b>{$count}</b> new {$noun} to š¦<b>{$payload->repository->full_name}:<code>{$branch}</code></b>\n\n"; + +foreach ($payload->commits as $commit) { + $commitId = substr($commit->id, -7); + $message .= "<a href=\"{$commit->url}\">{$commitId}</a>: {$commit->message} - by <i>{$commit->author->name}</i>\n"; +} + +$message .= "\nš¤ Pushed by : <b>{$payload->pusher->name}</b>\n"; + +echo $message; diff --git a/resources/views/events/github/watch/started.blade.php b/resources/views/events/github/watch/started.blade.php new file mode 100644 index 0000000..1f9dc6d --- /dev/null +++ b/resources/views/events/github/watch/started.blade.php @@ -0,0 +1,10 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "š <b>Watch Started</b> form š¦<a href=\"{$payload->repository->html_url}\">{$payload->repository->full_name}</a>\n\n"; + +$message .= "š¤ Watcher: <b>{$payload->sender->login}</b> š\n\n"; + +echo $message; diff --git a/resources/views/events/github/workflow_job/completed.blade.php b/resources/views/events/github/workflow_job/completed.blade.php new file mode 100644 index 0000000..3497a82 --- /dev/null +++ b/resources/views/events/github/workflow_job/completed.blade.php @@ -0,0 +1,18 @@ +<?php +/** + * @var $payload mixed + */ + +if ($payload->workflow_job->conclusion === 'success') { + $message = "š <b>Action Completed</b> form š¦<a href=\"{$payload->repository->html_url}\">{$payload->repository->full_name}</a>\n\n"; + + $message .= "Done action: š <b>{$payload->workflow_job->runner_name}</b> āØ \n\n"; +} else { + $message = "š« <b>Canceled Action</b> form š¦<a href=\"{$payload->repository->html_url}\">{$payload->repository->full_name}</a>\n\n"; + + $message .= "Failed action: š« <b>{$payload->workflow_job->runner_name}</b> ā \n\n"; +} + +$message .= "š Link: <a href=\"{$payload->workflow_job->html_url}\">{$payload->workflow_job->html_url}</a>\n\n"; + +echo $message; diff --git a/resources/views/events/github/workflow_job/in_progress.blade.php b/resources/views/events/github/workflow_job/in_progress.blade.php new file mode 100644 index 0000000..ef5dbea --- /dev/null +++ b/resources/views/events/github/workflow_job/in_progress.blade.php @@ -0,0 +1,12 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "š§ <b>Action in progress</b> form š¦<a href=\"{$payload->repository->html_url}\">{$payload->repository->full_name} </a>\n\n"; + +$message .= "Running action: š„ <b>{$payload->workflow_job->runner_name}</b> ā³\n\n"; + +$message .= "š Link: <a href=\"{$payload->workflow_job->html_url}\">{$payload->workflow_job->html_url}</a>\n\n"; + +echo $message; diff --git a/resources/views/events/github/workflow_job/queued.blade.php b/resources/views/events/github/workflow_job/queued.blade.php new file mode 100644 index 0000000..d2fab19 --- /dev/null +++ b/resources/views/events/github/workflow_job/queued.blade.php @@ -0,0 +1,10 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "š <b>Action Queued</b> form š¦<a href=\"{$payload->repository->html_url}\">{$payload->repository->full_name}</a>\n\n"; + +$message .= "Queued action: š„ <b>{$payload->workflow_job->runner_name}</b> ā°\n\n"; + +$message .= "š Link: <a href=\"{$payload->workflow_job->html_url}\">{$payload->workflow_job->html_url}</a>\n\n"; diff --git a/resources/views/events/github/workflow_run/completed.blade.php b/resources/views/events/github/workflow_run/completed.blade.php new file mode 100644 index 0000000..951134b --- /dev/null +++ b/resources/views/events/github/workflow_run/completed.blade.php @@ -0,0 +1,37 @@ +<?php +/** + * @var $payload mixed + */ + +switch ($payload->workflow_run->conclusion) { + case 'success': + $message = "š <b>Workflow Completed</b> form š¦<a href=\"{$payload->repository->html_url}\">{$payload->repository->full_name}</a>\n\n"; + + $message .= "Done workflow: š <b>{$payload->workflow_run->name}</b> āØ \n\n"; + + break; + case 'failure': + $message = "š« <b>Workflow Failed</b> form š¦<a href=\"{$payload->repository->html_url}\">{$payload->repository->full_name}</a>\n\n"; + + $message .= "Failed workflow: š« <b>{$payload->workflow_run->name}</b> ā \n\n"; + + break; + case 'cancelled': + $message = "ā <b>Workflow Cancelled</b> form š¦<a href=\"{$payload->repository->html_url}\">{$payload->repository->full_name}</a>\n\n"; + + $message .= "Cancelled workflow: šØ <b>{$payload->workflow_run->name}</b> ā \n\n"; + + break; + default: + $message = "šØ <b>Workflow Can't Success</b> form š¦<a href=\"{$payload->repository->html_url}\">{$payload->repository->full_name}</a>\n\n"; + + $message .= "Can't Success workflow: šØ <b>{$payload->workflow_run->name}</b> ā \n\n"; + + break; +} + +// $message .= "š¤ Commit: <b>{$payload->workflow_run->head_commit->message}</b>\n\n"; + +$message .= "š Link: <a href=\"{$payload->workflow_run->html_url}\">{$payload->workflow_run->html_url}</a>\n\n"; + +echo $message; diff --git a/resources/views/events/github/workflow_run/requested.blade.php b/resources/views/events/github/workflow_run/requested.blade.php new file mode 100644 index 0000000..1c15c87 --- /dev/null +++ b/resources/views/events/github/workflow_run/requested.blade.php @@ -0,0 +1,14 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "š§ <b>Workflow Requested</b> form š¦<a href=\"{$payload->repository->html_url}\">{$payload->repository->full_name}</a>\n\n"; + +$message .= "Running workflow: š„ <b>{$payload->workflow_run->name}</b> ā³\n\n"; + +// $message .= "š¤ Commit: <b>{$payload->workflow_run->head_commit->message}</b>\n\n"; + +$message .= "š Link: <a href=\"{$payload->workflow_run->html_url}\">{$payload->workflow_run->html_url}</a>\n\n"; + +echo $message; diff --git a/resources/views/events/gitlab/feature_flag/default.blade.php b/resources/views/events/gitlab/feature_flag/default.blade.php new file mode 100644 index 0000000..1229495 --- /dev/null +++ b/resources/views/events/gitlab/feature_flag/default.blade.php @@ -0,0 +1,22 @@ +<?php +/** + * @var $payload mixed + */ + +if ($payload->object_attributes->active) { + $active = "Enabled"; + $icon = "š©"; +} else { + $active = "Disabled"; + $icon = "š“"; +} + +$flagUrl = $payload->project->web_url . "/-/feature_flags/" . $payload->object_attributes->id; + +$message = "{$icon} <b>Feature Flag {$active}</b> - š¦<a href=\"{$flagUrl}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->name}</a> by <a href=\"{$payload->user_url}\">{$payload->user->name}</a>\n\n"; + +$message .= "{$icon} Name: <b>{$payload->object_attributes->name}</b> \n\n"; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; + +echo $message; diff --git a/resources/views/events/gitlab/issue/close.blade.php b/resources/views/events/gitlab/issue/close.blade.php new file mode 100644 index 0000000..1ee4703 --- /dev/null +++ b/resources/views/events/gitlab/issue/close.blade.php @@ -0,0 +1,14 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "š« <b>Issue Closed </b> to š¦<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->id}</a> by <b>{$payload->user->name}</b>\n\n"; + +$message .= "š¢ <b>{$payload->object_attributes->title}</b>\n"; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; + +echo $message; diff --git a/resources/views/events/gitlab/issue/open.blade.php b/resources/views/events/gitlab/issue/open.blade.php new file mode 100644 index 0000000..5ee93a3 --- /dev/null +++ b/resources/views/events/gitlab/issue/open.blade.php @@ -0,0 +1,14 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "ā ļø <b>New Issue</b> to š¦<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->id}</a> created by <b>{$payload->user->name}</b>\n\n"; + +$message .= "š¢ <b>{$payload->object_attributes->title}</b>\n"; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; + +echo $message; diff --git a/resources/views/events/gitlab/issue/reopen.blade.php b/resources/views/events/gitlab/issue/reopen.blade.php new file mode 100644 index 0000000..231fc7a --- /dev/null +++ b/resources/views/events/gitlab/issue/reopen.blade.php @@ -0,0 +1,14 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "ā ļø <b>Issue has been reopened</b> ā ļø to š¦<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->id}</a> by <b>{$payload->user->name}</b>\n\n"; + +$message .= "š¢ <b>{$payload->object_attributes->title}</b>\n"; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; + +echo $message; diff --git a/resources/views/events/gitlab/issue/update.blade.php b/resources/views/events/gitlab/issue/update.blade.php new file mode 100644 index 0000000..eb23e72 --- /dev/null +++ b/resources/views/events/gitlab/issue/update.blade.php @@ -0,0 +1,14 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "ā ļø <b>Issue has been edited</b> to š¦<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->id}</a> by <b>{$payload->user->name}</b>\n\n"; + +$message .= "š¢ <b>{$payload->object_attributes->title}</b>\n"; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; + +echo $message; diff --git a/resources/views/events/gitlab/merge_request/approved.blade.php b/resources/views/events/gitlab/merge_request/approved.blade.php new file mode 100644 index 0000000..401556b --- /dev/null +++ b/resources/views/events/gitlab/merge_request/approved.blade.php @@ -0,0 +1,18 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "ā <b>Merge Request Approved</b> to š¦<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->iid}</a> by <b>{$payload->user->name}</b>\n\n"; + +$message .= "š <b>{$payload->object_attributes->title}</b> \n\n"; + +$message .= "š³ {$payload->object_attributes->source_branch} -> {$payload->object_attributes->target_branch} šÆ \n"; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; + +$message .= require __DIR__ . '/partials/_reviewers.php'; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; + +echo $message; diff --git a/resources/views/events/gitlab/merge_request/close.blade.php b/resources/views/events/gitlab/merge_request/close.blade.php new file mode 100644 index 0000000..612677f --- /dev/null +++ b/resources/views/events/gitlab/merge_request/close.blade.php @@ -0,0 +1,18 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "ā <b>Close Merge Request</b> - š¦<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->iid}</a> by <b>{$payload->user->name}</b>\n\n"; + +$message .= "š <b>{$payload->object_attributes->title}</b> \n\n"; + +$message .= "š³ {$payload->object_attributes->source_branch} -> {$payload->object_attributes->target_branch} šÆ \n"; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; + +$message .= require __DIR__ . '/partials/_reviewers.php'; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; + +echo $message; diff --git a/resources/views/events/gitlab/merge_request/merge.blade.php b/resources/views/events/gitlab/merge_request/merge.blade.php new file mode 100644 index 0000000..d653cb9 --- /dev/null +++ b/resources/views/events/gitlab/merge_request/merge.blade.php @@ -0,0 +1,18 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "ā š <b>Merge Request Merged</b> to š¦<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->iid}</a> by <b>{$payload->user->name}</b>\n\n"; + +$message .= "š <b>{$payload->object_attributes->title}</b> \n\n"; + +$message .= "š³ {$payload->object_attributes->source_branch} -> {$payload->object_attributes->target_branch} šÆ \n"; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; + +$message .= require __DIR__ . '/partials/_reviewers.php'; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; + +echo $message; diff --git a/resources/views/events/gitlab/merge_request/open.blade.php b/resources/views/events/gitlab/merge_request/open.blade.php new file mode 100644 index 0000000..d5a6efd --- /dev/null +++ b/resources/views/events/gitlab/merge_request/open.blade.php @@ -0,0 +1,18 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "š·āāļøš ļø <b>Merge Request Opened</b> to š¦<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->iid}</a> by <b>{$payload->user->name}</b>\n\n"; + +$message .= "š <b>{$payload->object_attributes->title}</b> \n\n"; + +$message .= "š³ {$payload->object_attributes->source_branch} -> {$payload->object_attributes->target_branch} šÆ \n"; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; + +$message .= require __DIR__ . '/partials/_reviewers.php'; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; + +echo $message; diff --git a/resources/views/events/gitlab/merge_request/partials/_reviewers.blade.php b/resources/views/events/gitlab/merge_request/partials/_reviewers.blade.php new file mode 100644 index 0000000..0dfbfa8 --- /dev/null +++ b/resources/views/events/gitlab/merge_request/partials/_reviewers.blade.php @@ -0,0 +1,16 @@ +<?php +/** + * @var $payload mixed + */ + +$textReviewers = ''; +if (isset($payload->reviewers) && count($payload->reviewers) > 0) { + $reviewers = []; + foreach ($payload->reviewers as $reviewer) { + $reviewers[] = "<b>{$reviewer->name}</b>"; + } + + $textReviewers .= "š„ Reviewers: " . implode(', ', $reviewers) . "\n"; +} + +return $textReviewers; diff --git a/resources/views/events/gitlab/merge_request/reopen.blade.php b/resources/views/events/gitlab/merge_request/reopen.blade.php new file mode 100644 index 0000000..d990d52 --- /dev/null +++ b/resources/views/events/gitlab/merge_request/reopen.blade.php @@ -0,0 +1,18 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "š·āāļøš ļø <b>Merge Request Reopened</b> to š¦<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->iid}</a> by <b>{$payload->user->name}</b>\n\n"; + +$message .= "š <b>{$payload->object_attributes->title}</b> \n\n"; + +$message .= "š³ {$payload->object_attributes->source_branch} -> {$payload->object_attributes->target_branch} šÆ \n"; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; + +$message .= require __DIR__ . '/partials/_reviewers.php'; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; + +echo $message; diff --git a/resources/views/events/gitlab/merge_request/unapproval.blade.php b/resources/views/events/gitlab/merge_request/unapproval.blade.php new file mode 100644 index 0000000..e7e3554 --- /dev/null +++ b/resources/views/events/gitlab/merge_request/unapproval.blade.php @@ -0,0 +1,18 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "āāš ļø <b>Merge Request Unapproved</b> to š¦<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->iid}</a> by <b>{$payload->user->name}</b>\n\n"; + +$message .= "š <b>{$payload->object_attributes->title}</b> \n\n"; + +$message .= "š³ {$payload->object_attributes->source_branch} -> {$payload->object_attributes->target_branch} šÆ \n"; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; + +$message .= require __DIR__ . '/partials/_reviewers.php'; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; + +echo $message; diff --git a/resources/views/events/gitlab/merge_request/unapproved.blade.php b/resources/views/events/gitlab/merge_request/unapproved.blade.php new file mode 100644 index 0000000..612677f --- /dev/null +++ b/resources/views/events/gitlab/merge_request/unapproved.blade.php @@ -0,0 +1,18 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "ā <b>Close Merge Request</b> - š¦<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->iid}</a> by <b>{$payload->user->name}</b>\n\n"; + +$message .= "š <b>{$payload->object_attributes->title}</b> \n\n"; + +$message .= "š³ {$payload->object_attributes->source_branch} -> {$payload->object_attributes->target_branch} šÆ \n"; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; + +$message .= require __DIR__ . '/partials/_reviewers.php'; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; + +echo $message; diff --git a/resources/views/events/gitlab/merge_request/update.blade.php b/resources/views/events/gitlab/merge_request/update.blade.php new file mode 100644 index 0000000..8a8dac3 --- /dev/null +++ b/resources/views/events/gitlab/merge_request/update.blade.php @@ -0,0 +1,18 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "š·āāļøš ļø <b>Merge Request Updated</b> to š¦<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->iid}</a> by <b>{$payload->user->name}</b>\n\n"; + +$message .= "š <b>{$payload->object_attributes->title}</b> \n\n"; + +$message .= "š³ {$payload->object_attributes->source_branch} -> {$payload->object_attributes->target_branch} šÆ \n"; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; + +$message .= require __DIR__ . '/partials/_reviewers.php'; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; + +echo $message; diff --git a/resources/views/events/gitlab/note/commit.blade.php b/resources/views/events/gitlab/note/commit.blade.php new file mode 100644 index 0000000..bb24184 --- /dev/null +++ b/resources/views/events/gitlab/note/commit.blade.php @@ -0,0 +1,14 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "š¬ <b>New Comment on Commit</b> - š¦<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}</a> by <b>{$payload->user->name}</b>\n\n"; + +$message .= "āļø <b>{$payload->commit->message}</b> \n\n"; + +$message .= "š View Comment: <a href=\"{$payload->object_attributes->url}\">{$payload->commit->id}</a> \n\n"; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; + +echo $message; diff --git a/resources/views/events/gitlab/note/issue.blade.php b/resources/views/events/gitlab/note/issue.blade.php new file mode 100644 index 0000000..8009523 --- /dev/null +++ b/resources/views/events/gitlab/note/issue.blade.php @@ -0,0 +1,12 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "š¬ <b>New Comment on Issue</b> - š¦<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->issue->iid}</a> by <b>{$payload->user->name}</b>\n\n"; + +$message .= "š¢ <b>{$payload->issue->title}</b> \n\n"; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; + +echo $message; diff --git a/resources/views/events/gitlab/note/merge_request.blade.php b/resources/views/events/gitlab/note/merge_request.blade.php new file mode 100644 index 0000000..149e932 --- /dev/null +++ b/resources/views/events/gitlab/note/merge_request.blade.php @@ -0,0 +1,14 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "š¬ <b>New Comment on Merge Request</b> - š¦<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->merge_request->iid}</a> by <b>{$payload->user->name}</b>\n\n"; + +$message .= "š <b>{$payload->merge_request->title}</b> \n"; + +$message .= "š³ {$payload->merge_request->source_branch} -> {$payload->merge_request->target_branch} šÆ \n"; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; + +echo $message; diff --git a/resources/views/events/gitlab/note/snippet.blade.php b/resources/views/events/gitlab/note/snippet.blade.php new file mode 100644 index 0000000..783c37e --- /dev/null +++ b/resources/views/events/gitlab/note/snippet.blade.php @@ -0,0 +1,14 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "š¬ <b>New Comment on Snippet</b> - š¦<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}</a> by <b>{$payload->user->name}</b>\n\n"; + +$message .= "š <b>{$payload->snippet->title}</b> \n\n"; + +$message .= "š <a href=\"{$payload->object_attributes->url}\">View Comment</a> \n\n"; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; + +echo $message; diff --git a/resources/views/events/gitlab/push/default.blade.php b/resources/views/events/gitlab/push/default.blade.php new file mode 100644 index 0000000..6bde206 --- /dev/null +++ b/resources/views/events/gitlab/push/default.blade.php @@ -0,0 +1,21 @@ +<?php +/** + * @var $payload mixed + */ + +$count = count($payload->commits); +$noun = ($count > 1) ? "commits" : "commit"; + +$ref = explode('/', $payload->ref); +$branch = implode('/', array_slice($ref, 2)); + +$message = "āļø <b>{$count}</b> new {$noun} to š¦<b>{$payload->project->path_with_namespace}:<code>{$branch}</code></b>\n\n"; + +foreach ($payload->commits as $commit) { + $commitId = substr($commit->id, -7); + $message .= "<a href=\"{$commit->url}\">{$commitId}</a>: {$commit->message} - by <i>{$commit->author->name}</i>\n"; +} + +$message .= "\nš¤ Pushed by : <b>{$payload->user_name}</b>\n"; + +echo $message; diff --git a/resources/views/events/gitlab/release/create.blade.php b/resources/views/events/gitlab/release/create.blade.php new file mode 100644 index 0000000..f0fe6d7 --- /dev/null +++ b/resources/views/events/gitlab/release/create.blade.php @@ -0,0 +1,14 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "ā š <b>Release Created</b> - š¦<a href=\"{$payload->url}\">{$payload->project->path_with_namespace}#{$payload->tag}</a> by <b>{$payload->commit->author->name}</b>\n\n"; + +$message .= "š <b>{$payload->tag}</b> \n"; + +$message .= "š <b>{$payload->name}</b> \n"; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; + +echo $message; diff --git a/resources/views/events/gitlab/release/update.blade.php b/resources/views/events/gitlab/release/update.blade.php new file mode 100644 index 0000000..092ddbb --- /dev/null +++ b/resources/views/events/gitlab/release/update.blade.php @@ -0,0 +1,14 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "šš <b>Release Updated</b> - š¦<a href=\"{$payload->url}\">{$payload->project->path_with_namespace}#{$payload->tag}</a> by <b>{$payload->commit->author->name}</b>\n\n"; + +$message .= "š <b>{$payload->tag}</b> \n"; + +$message .= "š <b>{$payload->name}</b> \n"; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; + +echo $message; diff --git a/resources/views/events/gitlab/tag_push/default.blade.php b/resources/views/events/gitlab/tag_push/default.blade.php new file mode 100644 index 0000000..30a1b6e --- /dev/null +++ b/resources/views/events/gitlab/tag_push/default.blade.php @@ -0,0 +1,17 @@ +<?php +/** + * @var $payload mixed + */ + +$ref = explode('/', $payload->ref); +$tag = implode('/', array_slice($ref, 2)); + +$tagUrl = $payload->project->web_url . '/tags/' . $tag; + +$message = "āļø <b>A new tag has been pushed to the project</b> š¦<a href=\"{$payload->project->web_url}\">{$payload->project->path_with_namespace}</a>\n\n"; + +$message .= "š Tag: <a href=\"{$tagUrl}\">{$tag}</a>\n\n"; + +$message .= "š¤ Pushed by : <b>{$payload->user_name}</b>\n"; + +echo $message; diff --git a/resources/views/events/gitlab/wiki_page/create.blade.php b/resources/views/events/gitlab/wiki_page/create.blade.php new file mode 100644 index 0000000..761741a --- /dev/null +++ b/resources/views/events/gitlab/wiki_page/create.blade.php @@ -0,0 +1,12 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "š <b>Wiki Page Created</b> - š¦<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->slug}</a> by <b>{$payload->user->name}</b>\n\n"; + +$message .= "š· Title: <b>{$payload->object_attributes->title}</b> \n\n"; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; + +echo $message; diff --git a/resources/views/events/gitlab/wiki_page/delete.blade.php b/resources/views/events/gitlab/wiki_page/delete.blade.php new file mode 100644 index 0000000..3943a12 --- /dev/null +++ b/resources/views/events/gitlab/wiki_page/delete.blade.php @@ -0,0 +1,10 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "š <b>Wiki Page Deleted</b> - š¦<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->slug}</a> by <b>{$payload->user->name}</b>\n\n"; + +$message .= "š· Title: <b>{$payload->object_attributes->title}</b> \n\n"; + +echo $message; diff --git a/resources/views/events/gitlab/wiki_page/update.blade.php b/resources/views/events/gitlab/wiki_page/update.blade.php new file mode 100644 index 0000000..a163760 --- /dev/null +++ b/resources/views/events/gitlab/wiki_page/update.blade.php @@ -0,0 +1,12 @@ +<?php +/** + * @var $payload mixed + */ + +$message = "š <b>Wiki Page Updated</b> - š¦<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->slug}</a> by <b>{$payload->user->name}</b>\n\n"; + +$message .= "š· Title: <b>{$payload->object_attributes->title}</b> \n\n"; + +$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; + +echo $message; diff --git a/resources/views/events/shared/partials/github/_assignees.blade.php b/resources/views/events/shared/partials/github/_assignees.blade.php index 6220e0a..6fa61b0 100644 --- a/resources/views/events/shared/partials/github/_assignees.blade.php +++ b/resources/views/events/shared/partials/github/_assignees.blade.php @@ -5,7 +5,7 @@ */ if (isset($event) && isset($payload) && !empty($payload->{$event}->assignees)) { - $assigneeText = "š Assignee: "; + $assigneeText = __('tg-notifier::events/shared/github._assignee.title'); $assigneeArray = []; foreach ($payload->{$event}->assignees as $assignee) { $assigneeArray[] = "<a href=\"{$assignee->html_url}\">@{$assignee->login}</a> "; diff --git a/resources/views/events/shared/partials/gitlab/_assignees.blade.php b/resources/views/events/shared/partials/gitlab/_assignees.blade.php new file mode 100644 index 0000000..6986551 --- /dev/null +++ b/resources/views/events/shared/partials/gitlab/_assignees.blade.php @@ -0,0 +1,16 @@ +<?php +/** + * @var $payload mixed + * @var $event string + */ + +if (isset($event) && isset($payload) && !empty($payload->assignees)) { + $assigneeText = "š Assignee: "; + $assigneeArray = []; + foreach ($payload->assignees as $assignee) { + $assigneeArray[] = "<b>{$assignee->name}</b>"; + } + $assigneeText .= implode(', ', $assigneeArray) . "\n"; +} + +return $assigneeText ?? ''; diff --git a/resources/views/events/shared/partials/gitlab/_body.blade.php b/resources/views/events/shared/partials/gitlab/_body.blade.php new file mode 100644 index 0000000..fb505db --- /dev/null +++ b/resources/views/events/shared/partials/gitlab/_body.blade.php @@ -0,0 +1,27 @@ +<?php +/** + * @var $payload mixed + */ + +if (isset($event) && isset($payload)) { + if (!empty($payload->object_attributes->description)) { + $body = $payload->object_attributes->description; + } elseif (!empty($payload->object_attributes->content)) { + $body = $payload->object_attributes->content; + } elseif (!empty($payload->object_attributes->note)) { + $body = $payload->object_attributes->note; + } elseif (!empty($payload->object_attributes->body)) { + $body = $payload->object_attributes->body; + } elseif (!empty($payload->description)) { + $body = $payload->description; + } else { + return ''; + } + if (strlen($body) > 50) { + $body = substr($body, 0, 50) . '...'; + } + + return "š <b>Content:</b>\n{$body}"; +} + +return ''; diff --git a/resources/views/globals/access_denied.blade.php b/resources/views/globals/access_denied.blade.php new file mode 100644 index 0000000..0d77683 --- /dev/null +++ b/resources/views/globals/access_denied.blade.php @@ -0,0 +1,14 @@ +<?php +/** + * @var $chatId string + */ + +$message = 'š <b>Access Denied to Bot</b> š«'; + +if (!empty($chatId)) { + $message .= "\n\nš <b>Chat ID:</b> <code>{$chatId}</code> \n"; +} + +$message .= 'Please contact the administrator for further information, Thank You..'; + +echo $message; diff --git a/resources/views/tools/about.blade.php b/resources/views/tools/about.blade.php new file mode 100644 index 0000000..0efe8c2 --- /dev/null +++ b/resources/views/tools/about.blade.php @@ -0,0 +1,3 @@ +Thanks for using our bot. + +The bot is designed to send notifications based on GitHub and GitLab events from your repo instantly to your Telegram account. diff --git a/resources/views/tools/custom_event.blade.php b/resources/views/tools/custom_event.blade.php new file mode 100644 index 0000000..a40ce49 --- /dev/null +++ b/resources/views/tools/custom_event.blade.php @@ -0,0 +1,14 @@ +<?php +/** + * @var string $platform + */ + +$docsUrl = 'https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads'; +if ($platform === 'gitlab') { + $docsUrl = 'https://docs.gitlab.com/ee/user/project/integrations/webhooks.html'; +} +?> +Go to check the <a href="<?= $docsUrl ?>"><?= $platform ?> documentation</a> for more information about events. +--- +<b>Click and configure child events if the option has the ā icon.</b> +And select an event to enable or disable notifications: diff --git a/resources/views/tools/custom_event_action.blade.php b/resources/views/tools/custom_event_action.blade.php new file mode 100644 index 0000000..297aff0 --- /dev/null +++ b/resources/views/tools/custom_event_action.blade.php @@ -0,0 +1,13 @@ +<?php +/** + * @var string $event + * @var string $platform + */ + +$platformIcon = 'š¦'; +if ($platform === 'gitlab') { + $platformIcon = 'š¦'; +} +?> +Setting actions for the <b><?= $event ?></b> event <?= $platformIcon ?>. +Please select an action of this event to enable or disable notifications: diff --git a/resources/views/tools/id.blade.php b/resources/views/tools/id.blade.php new file mode 100644 index 0000000..fe21c1b --- /dev/null +++ b/resources/views/tools/id.blade.php @@ -0,0 +1 @@ +Your id is <code><?= config('telegram-git-notifier.bot.chat_id') ?></code> diff --git a/resources/views/tools/server.blade.php b/resources/views/tools/server.blade.php new file mode 100644 index 0000000..f1c8ccf --- /dev/null +++ b/resources/views/tools/server.blade.php @@ -0,0 +1,4 @@ +Server Address : <a href="<?= $_SERVER['SERVER_ADDR'] ?>"><?= $_SERVER['SERVER_ADDR'] ?></a> +Server Name : <a href="<?= $_SERVER['SERVER_NAME'] ?>"><?= $_SERVER['SERVER_NAME'] ?></a> +Server Port : <a href="<?= $_SERVER['SERVER_PORT'] ?>"><?= $_SERVER['SERVER_PORT'] ?></a> +Server Software : <a href="<?= $_SERVER['SERVER_SOFTWARE'] ?>"><?= $_SERVER['SERVER_SOFTWARE'] ?></a> diff --git a/resources/views/tools/set_menu_cmd.blade.php b/resources/views/tools/set_menu_cmd.blade.php new file mode 100644 index 0000000..6b22b5d --- /dev/null +++ b/resources/views/tools/set_menu_cmd.blade.php @@ -0,0 +1,3 @@ +ā Menu button set successfully! + +Please restart the bot to apply the changes. diff --git a/resources/views/tools/settings.blade.php b/resources/views/tools/settings.blade.php new file mode 100644 index 0000000..a1a03bf --- /dev/null +++ b/resources/views/tools/settings.blade.php @@ -0,0 +1 @@ +<b>Settings for your bot</b> š¤ diff --git a/resources/views/tools/start.blade.php b/resources/views/tools/start.blade.php new file mode 100644 index 0000000..3eb7f16 --- /dev/null +++ b/resources/views/tools/start.blade.php @@ -0,0 +1,12 @@ +<?php +/** + * @var string $first_name + */ + +?> +<b>šš» <?= config('telegram-git-notifier.app.name') ?> š¤</b> + +Hey <b><?= $first_name ?></b>, + +I can send you notifications from your š¦<b>GitHub</b> or š¦<b>GitLab</b> Repository instantly to your Telegram. +Use /menu for more options. diff --git a/resources/views/tools/token.blade.php b/resources/views/tools/token.blade.php new file mode 100644 index 0000000..c150a6b --- /dev/null +++ b/resources/views/tools/token.blade.php @@ -0,0 +1 @@ +This bot token is: <code><?= config('telegram-git-notifier.bot.token') ?></code> diff --git a/resources/views/tools/usage.blade.php b/resources/views/tools/usage.blade.php new file mode 100644 index 0000000..377163e --- /dev/null +++ b/resources/views/tools/usage.blade.php @@ -0,0 +1,18 @@ +<b>Adding webhook (Web Address) to GitHub repositories</b> š¦ + +1) Redirect to <i>Repository Settings->Webhooks->Add Webhook</i>. +2) Set your Payload URL. +3) Set content type to "<code>application/x-www-form-urlencoded</code>". +4) Choose events would you like to trigger in this webhook. +(Recommended: <code>Let me select individual events</code>, and choose any events you want). +5) Check <code>Active</code> checkbox. And click <code>Add Webhook</code>. + +---------- +<b>Adding webhook (Web Address) to GitLab repositories</b> š¦ + +1) Redirect to <i>Repository Settings->Webhooks->Add new webhook</i>. +2) Set your Payload URL. +3) Choose events would you like to trigger in this webhook. +4) Check <code>Enable SSL verification</code> if you are using SSL. And click <code>Add Webhook</code>. + +<b>That it. you will receive all notifications through me š¤</b>