Skip to content

Commit

Permalink
Merge pull request #83 from tanhongit/gitlab-events
Browse files Browse the repository at this point in the history
feat: add gitlab events
  • Loading branch information
tanhongit authored May 23, 2024
2 parents 435e953 + 3656d62 commit 43a4560
Show file tree
Hide file tree
Showing 17 changed files with 124 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"require": {
"php": "^8.1",
"cslant/telegram-git-notifier": "^v1.3"
"cslant/telegram-git-notifier": "^v1.4"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^v3.0",
Expand Down
9 changes: 9 additions & 0 deletions lang/de/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,13 @@
'branch' => 'Branch',
'commit' => 'Commit',
'title' => 'Title',
'state' => 'State',
'confidential' => 'Confidential',
'status' => 'Status',
'link' => 'Link',
'repo' => 'Repository',
'author' => [
'name' => 'Name',
'email' => 'Email',
],
];
6 changes: 6 additions & 0 deletions lang/de/events/gitlab/job.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

return [
'title' => 'Update Job Status',
'name' => 'Job Name',
];
5 changes: 5 additions & 0 deletions lang/de/events/gitlab/pipeline.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

return [
'title' => 'Pipeline Status Update',
];
7 changes: 7 additions & 0 deletions lang/en/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,11 @@
'title' => 'Title',
'state' => 'State',
'confidential' => 'Confidential',
'status' => 'Status',
'link' => 'Link',
'repo' => 'Repository',
'author' => [
'name' => 'Name',
'email' => 'Email',
],
];
6 changes: 6 additions & 0 deletions lang/en/events/gitlab/job.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

return [
'title' => 'Update Job Status',
'name' => 'Job Name',
];
5 changes: 5 additions & 0 deletions lang/en/events/gitlab/pipeline.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

return [
'title' => 'Pipeline Status Update',
];
9 changes: 9 additions & 0 deletions lang/ja/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,13 @@
'branch' => 'Branch',
'commit' => 'Commit',
'title' => 'Title',
'state' => 'State',
'confidential' => 'Confidential',
'status' => 'Status',
'link' => 'Link',
'repo' => 'Repository',
'author' => [
'name' => 'Name',
'email' => 'Email',
],
];
6 changes: 6 additions & 0 deletions lang/ja/events/gitlab/job.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

return [
'title' => 'Update Job Status',
'name' => 'Job Name',
];
5 changes: 5 additions & 0 deletions lang/ja/events/gitlab/pipeline.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

return [
'title' => 'Pipeline Status Update',
];
7 changes: 7 additions & 0 deletions lang/vi/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,11 @@
'title' => 'Tiêu đề',
'state' => 'Trạng thái',
'confidential' => 'Bí mật',
'status' => 'Trạng thái',
'link' => 'Liên kết',
'repo' => 'Kho',
'author' => [
'name' => 'Tên',
'email' => 'Email',
],
];
6 changes: 6 additions & 0 deletions lang/vi/events/gitlab/job.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

return [
'title' => 'Cập nhật trạng thái của Job',
'name' => 'Tên Job',
];
5 changes: 5 additions & 0 deletions lang/vi/events/gitlab/pipeline.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

return [
'title' => 'Cập nhật trạng thái Pipeline',
];
8 changes: 8 additions & 0 deletions resources/views/events/gitlab/deployment/default.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
/**
* @var object $payload
* @var string $event
*/
?>
Need to implement this view
8 changes: 8 additions & 0 deletions resources/views/events/gitlab/emoji/default.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
/**
* @var object $payload
* @var string $event
*/
?>
Need to implement this view
16 changes: 16 additions & 0 deletions resources/views/events/gitlab/job/default.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* @var object $payload
* @var string $event
*/
?>

🛸 {{ __('tg-notifier::events/gitlab/job.title') }} 🦊

🚀 {{ __('tg-notifier::app.repo') }}: <a href="{{ $payload->project->web_url }}">{{ $payload->project->path_with_namespace }}</a>
🛸 {{ __('tg-notifier::events/gitlab/job.name') }}: <code>{{ $payload->build_name }}</code>
🌳 {{ __('tg-notifier::app.branch') }}: <code>{{ $payload->project->default_branch }}</code>
👤 {{ __('tg-notifier::app.author.name') }}: <code>{{ $payload->commit->author_name }}</code>
💻 {{ __('tg-notifier::app.commit') }}: <code>{{ $payload->commit->message }}</code>
🚦 {{ __('tg-notifier::app.status') }}: <code>{{ $payload->build_status }}</code>
15 changes: 15 additions & 0 deletions resources/views/events/gitlab/pipeline/default.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* @var object $payload
* @var string $event
*/
?>

🛰 {{ __('tg-notifier::events/gitlab/pipeline.title') }} 🦊

🚀 {{ __('tg-notifier::app.repo') }}: <a href="{{ $payload->project->web_url }}">{{ $payload->project->path_with_namespace }}</a>
🌳 {{ __('tg-notifier::app.branch') }}: <code>{{ $payload->object_attributes->ref }}</code>
👤 {{ __('tg-notifier::app.author.name') }}: <code>{{ $payload->commit->author->name }}</code>
💻 {{ __('tg-notifier::app.commit') }}: <a href="{{ $payload->commit->url }}">{{ $payload->commit->message }}</a>
🚦 {{ __('tg-notifier::app.status') }}: Pipeline <code>{{ $payload->object_attributes->status }}</code> <code>{{ $payload->object_attributes->duration ? "⏱️ {$payload->object_attributes->duration}s" : '' }}</code>

0 comments on commit 43a4560

Please sign in to comment.