From ca2e66511d2d0b8263b36ca50956a2a814317964 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Apr 2024 07:31:40 +0000 Subject: [PATCH 1/5] chore(deps): bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/dependabot-auto-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index f22ebab..f2bba4f 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -13,7 +13,7 @@ jobs: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v2.0.0 + uses: dependabot/fetch-metadata@v2.1.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" From 8fc1c0260561b1e8d4fcca624a835f3d82b71dcb Mon Sep 17 00:00:00 2001 From: Tan Nguyen Date: Sat, 11 May 2024 11:57:43 +0700 Subject: [PATCH 2/5] docs: update readme --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 68fe387..a42780d 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ ## πŸ“ Introduction -Laravel Telegram Git Notifier is a package that allows you to create a Telegram bot to receive notifications from GitHub +Laravel Telegram Git Notifier is a Laravel package that allows you to create a Telegram bot to receive notifications from GitHub or GitLab events and manage customization through messages and buttons on Telegram. - Send notifications of your GitHub/GitLab repositories to Telegram Bots, Groups, Super Groups (Multiple Topics), and @@ -58,13 +58,12 @@ information. - [x] Issue Comment - [x] Pull Request - [x] Pull Request Review -- [x] Pull Request Review Comment - [x] Fork - [x] Commit Comment - [x] Deployment - [x] Deployment Status - [x] Fork -- [x] Gollum +- [x] Workflow - [x] Watch ... and more events can be seen in the [all GitHub events available](https://docs.cslant.com/telegram-git-notifier/prologue/event-availability/github) From fafe9436bcf06cae8b0f76ef89bd71779df83319 Mon Sep 17 00:00:00 2001 From: Tan Nguyen Date: Sun, 12 May 2024 02:45:42 +0700 Subject: [PATCH 3/5] fix: update view template for tag push gitlab event --- lang/de/events/gitlab/tag_push.php | 6 +++--- lang/en/events/gitlab/tag_push.php | 6 +++--- lang/ja/events/gitlab/tag_push.php | 6 +++--- lang/vi/events/gitlab/tag_push.php | 6 +++--- .../views/events/gitlab/tag_push/default.blade.php | 13 ++++--------- 5 files changed, 16 insertions(+), 21 deletions(-) diff --git a/lang/de/events/gitlab/tag_push.php b/lang/de/events/gitlab/tag_push.php index d405f85..f070678 100644 --- a/lang/de/events/gitlab/tag_push.php +++ b/lang/de/events/gitlab/tag_push.php @@ -1,7 +1,7 @@ 'βš™οΈ A new tag has been pushed to the project 🦊:repo', - 'name' => 'πŸ”– Tag Name: :tag_name', - 'pusher' => 'πŸ‘€ Pushed by: :pusher', + 'title' => 'A new tag has been pushed to the project :repo', + 'name' => 'Tag Name: :tag_name', + 'pusher' => ' Pushed by', ]; diff --git a/lang/en/events/gitlab/tag_push.php b/lang/en/events/gitlab/tag_push.php index d405f85..f070678 100644 --- a/lang/en/events/gitlab/tag_push.php +++ b/lang/en/events/gitlab/tag_push.php @@ -1,7 +1,7 @@ 'βš™οΈ A new tag has been pushed to the project 🦊:repo', - 'name' => 'πŸ”– Tag Name: :tag_name', - 'pusher' => 'πŸ‘€ Pushed by: :pusher', + 'title' => 'A new tag has been pushed to the project :repo', + 'name' => 'Tag Name: :tag_name', + 'pusher' => ' Pushed by', ]; diff --git a/lang/ja/events/gitlab/tag_push.php b/lang/ja/events/gitlab/tag_push.php index d405f85..f070678 100644 --- a/lang/ja/events/gitlab/tag_push.php +++ b/lang/ja/events/gitlab/tag_push.php @@ -1,7 +1,7 @@ 'βš™οΈ A new tag has been pushed to the project 🦊:repo', - 'name' => 'πŸ”– Tag Name: :tag_name', - 'pusher' => 'πŸ‘€ Pushed by: :pusher', + 'title' => 'A new tag has been pushed to the project :repo', + 'name' => 'Tag Name: :tag_name', + 'pusher' => ' Pushed by', ]; diff --git a/lang/vi/events/gitlab/tag_push.php b/lang/vi/events/gitlab/tag_push.php index d405f85..f070678 100644 --- a/lang/vi/events/gitlab/tag_push.php +++ b/lang/vi/events/gitlab/tag_push.php @@ -1,7 +1,7 @@ 'βš™οΈ A new tag has been pushed to the project 🦊:repo', - 'name' => 'πŸ”– Tag Name: :tag_name', - 'pusher' => 'πŸ‘€ Pushed by: :pusher', + 'title' => 'A new tag has been pushed to the project :repo', + 'name' => 'Tag Name: :tag_name', + 'pusher' => ' Pushed by', ]; diff --git a/resources/views/events/gitlab/tag_push/default.blade.php b/resources/views/events/gitlab/tag_push/default.blade.php index 25c1573..5e784e5 100644 --- a/resources/views/events/gitlab/tag_push/default.blade.php +++ b/resources/views/events/gitlab/tag_push/default.blade.php @@ -8,14 +8,9 @@ $tagUrl = $payload->project->web_url.'/tags/'.$tag; ?> -{!! __('tg-notifier::events/gitlab/tag_push.title', [ - 'repo' => "{$payload->project->path_with_namespace}", +βš™οΈ {!! __('tg-notifier::events/gitlab/tag_push.title', [ + 'repo' => "🦊{$payload->project->path_with_namespace}", ]) !!} -{!! __('tg-notifier::events/gitlab/tag_push.name', [ - 'tag_name' => "{$tag}", - ]) !!} - -{!! __('tg-notifier::events/gitlab/tag_push.pusher', [ - 'pusher' => "{$payload->user_name}", - ]) !!} +πŸ”– {!! __('tg-notifier::events/gitlab/tag_push.name') !!}: {{ $tag }} +πŸ‘€ {!! __('tg-notifier::events/gitlab/tag_push.pusher') !!}: {{ $payload->user_name }} From 1b88d6d908fc74d83af441b513101aab4298cbb9 Mon Sep 17 00:00:00 2001 From: Tan Nguyen Date: Sun, 12 May 2024 02:55:40 +0700 Subject: [PATCH 4/5] fix: update view template for wiki gitlab event --- lang/de/events/gitlab/wiki_page.php | 8 ++++---- lang/de/events/shared/gitlab.php | 2 +- lang/en/events/gitlab/wiki_page.php | 8 ++++---- lang/en/events/shared/gitlab.php | 2 +- lang/ja/events/gitlab/wiki_page.php | 8 ++++---- lang/ja/events/shared/gitlab.php | 2 +- lang/vi/events/gitlab/wiki_page.php | 8 ++++---- lang/vi/events/shared/gitlab.php | 4 ++-- .../views/events/gitlab/wiki_page/create.blade.php | 10 ++++------ .../views/events/gitlab/wiki_page/delete.blade.php | 10 ++++------ .../views/events/gitlab/wiki_page/update.blade.php | 10 ++++------ .../events/shared/partials/gitlab/_body.blade.php | 14 ++++++++------ 12 files changed, 41 insertions(+), 45 deletions(-) diff --git a/lang/de/events/gitlab/wiki_page.php b/lang/de/events/gitlab/wiki_page.php index c700d96..db503dd 100644 --- a/lang/de/events/gitlab/wiki_page.php +++ b/lang/de/events/gitlab/wiki_page.php @@ -2,9 +2,9 @@ return [ 'title' => [ - 'create' => 'πŸ“’ Wiki Page Created - 🦊:repo by :user', - 'update' => 'πŸ“ Wiki Page Updated - 🦊:repo by :user', - 'delete' => 'πŸ—‘ Wiki Page Deleted - 🦊:repo by :user', + 'create' => 'Wiki Page Created - :repo by :user', + 'update' => 'Wiki Page Updated - :repo by :user', + 'delete' => 'Wiki Page Deleted - :repo by :user', ], - 'name' => 'πŸ“ Page Name: :name', + 'name' => 'Page Name', ]; diff --git a/lang/de/events/shared/gitlab.php b/lang/de/events/shared/gitlab.php index ce3f29f..75e6dfc 100644 --- a/lang/de/events/shared/gitlab.php +++ b/lang/de/events/shared/gitlab.php @@ -2,7 +2,7 @@ return [ '_body' => [ - 'title' => 'πŸ“– Content:', + 'title' => 'Content', ], '_assignee' => [ 'title' => 'πŸ™‹ Assignee: ', diff --git a/lang/en/events/gitlab/wiki_page.php b/lang/en/events/gitlab/wiki_page.php index c700d96..db503dd 100644 --- a/lang/en/events/gitlab/wiki_page.php +++ b/lang/en/events/gitlab/wiki_page.php @@ -2,9 +2,9 @@ return [ 'title' => [ - 'create' => 'πŸ“’ Wiki Page Created - 🦊:repo by :user', - 'update' => 'πŸ“ Wiki Page Updated - 🦊:repo by :user', - 'delete' => 'πŸ—‘ Wiki Page Deleted - 🦊:repo by :user', + 'create' => 'Wiki Page Created - :repo by :user', + 'update' => 'Wiki Page Updated - :repo by :user', + 'delete' => 'Wiki Page Deleted - :repo by :user', ], - 'name' => 'πŸ“ Page Name: :name', + 'name' => 'Page Name', ]; diff --git a/lang/en/events/shared/gitlab.php b/lang/en/events/shared/gitlab.php index ce3f29f..75e6dfc 100644 --- a/lang/en/events/shared/gitlab.php +++ b/lang/en/events/shared/gitlab.php @@ -2,7 +2,7 @@ return [ '_body' => [ - 'title' => 'πŸ“– Content:', + 'title' => 'Content', ], '_assignee' => [ 'title' => 'πŸ™‹ Assignee: ', diff --git a/lang/ja/events/gitlab/wiki_page.php b/lang/ja/events/gitlab/wiki_page.php index c700d96..db503dd 100644 --- a/lang/ja/events/gitlab/wiki_page.php +++ b/lang/ja/events/gitlab/wiki_page.php @@ -2,9 +2,9 @@ return [ 'title' => [ - 'create' => 'πŸ“’ Wiki Page Created - 🦊:repo by :user', - 'update' => 'πŸ“ Wiki Page Updated - 🦊:repo by :user', - 'delete' => 'πŸ—‘ Wiki Page Deleted - 🦊:repo by :user', + 'create' => 'Wiki Page Created - :repo by :user', + 'update' => 'Wiki Page Updated - :repo by :user', + 'delete' => 'Wiki Page Deleted - :repo by :user', ], - 'name' => 'πŸ“ Page Name: :name', + 'name' => 'Page Name', ]; diff --git a/lang/ja/events/shared/gitlab.php b/lang/ja/events/shared/gitlab.php index ce3f29f..75e6dfc 100644 --- a/lang/ja/events/shared/gitlab.php +++ b/lang/ja/events/shared/gitlab.php @@ -2,7 +2,7 @@ return [ '_body' => [ - 'title' => 'πŸ“– Content:', + 'title' => 'Content', ], '_assignee' => [ 'title' => 'πŸ™‹ Assignee: ', diff --git a/lang/vi/events/gitlab/wiki_page.php b/lang/vi/events/gitlab/wiki_page.php index c700d96..db503dd 100644 --- a/lang/vi/events/gitlab/wiki_page.php +++ b/lang/vi/events/gitlab/wiki_page.php @@ -2,9 +2,9 @@ return [ 'title' => [ - 'create' => 'πŸ“’ Wiki Page Created - 🦊:repo by :user', - 'update' => 'πŸ“ Wiki Page Updated - 🦊:repo by :user', - 'delete' => 'πŸ—‘ Wiki Page Deleted - 🦊:repo by :user', + 'create' => 'Wiki Page Created - :repo by :user', + 'update' => 'Wiki Page Updated - :repo by :user', + 'delete' => 'Wiki Page Deleted - :repo by :user', ], - 'name' => 'πŸ“ Page Name: :name', + 'name' => 'Page Name', ]; diff --git a/lang/vi/events/shared/gitlab.php b/lang/vi/events/shared/gitlab.php index 521706f..75e6dfc 100644 --- a/lang/vi/events/shared/gitlab.php +++ b/lang/vi/events/shared/gitlab.php @@ -2,9 +2,9 @@ return [ '_body' => [ - 'title' => 'πŸ“– Nα»™i dung:', + 'title' => 'Content', ], '_assignee' => [ - 'title' => 'πŸ™‹ Người được giao: ', + 'title' => 'πŸ™‹ Assignee: ', ], ]; diff --git a/resources/views/events/gitlab/wiki_page/create.blade.php b/resources/views/events/gitlab/wiki_page/create.blade.php index df86002..31bad74 100644 --- a/resources/views/events/gitlab/wiki_page/create.blade.php +++ b/resources/views/events/gitlab/wiki_page/create.blade.php @@ -5,13 +5,11 @@ */ ?> -{!! __('tg-notifier::events/gitlab/wiki_page.title.create', [ - 'repo' => "{$payload->project->path_with_namespace}#{$payload->object_attributes->slug}", - 'user' => "{$payload->user->name}" +πŸ“’ {!! __('tg-notifier::events/gitlab/wiki_page.title.create', [ + 'repo' => "🦊{$payload->project->path_with_namespace}#{$payload->object_attributes->slug}", + 'user' => "{$payload->user->name}" ]) !!} -{!! __('tg-notifier::events/gitlab/wiki_page.name', [ - 'name' => "{$payload->object_attributes->title}" - ]) !!} +πŸ“ {!! __('tg-notifier::events/gitlab/wiki_page.name') !!}: {{ $payload->object_attributes->title }} @include('tg-notifier::events.shared.partials.gitlab._body', compact('payload', 'event')) diff --git a/resources/views/events/gitlab/wiki_page/delete.blade.php b/resources/views/events/gitlab/wiki_page/delete.blade.php index 2bffcfe..e797664 100644 --- a/resources/views/events/gitlab/wiki_page/delete.blade.php +++ b/resources/views/events/gitlab/wiki_page/delete.blade.php @@ -5,13 +5,11 @@ */ ?> -{!! __('tg-notifier::events/gitlab/wiki_page.title.delete', [ - 'repo' => "{$payload->project->path_with_namespace}#{$payload->object_attributes->slug}", - 'user' => "{$payload->user->name}" +πŸ—‘ {!! __('tg-notifier::events/gitlab/wiki_page.title.delete', [ + 'repo' => "🦊{$payload->project->path_with_namespace}#{$payload->object_attributes->slug}", + 'user' => "{$payload->user->name}" ]) !!} -{!! __('tg-notifier::events/gitlab/wiki_page.name', [ - 'name' => "{$payload->object_attributes->title}" - ]) !!} +πŸ“ {!! __('tg-notifier::events/gitlab/wiki_page.name') !!}: {{ $payload->object_attributes->title }} @include('tg-notifier::events.shared.partials.gitlab._body', compact('payload', 'event')) diff --git a/resources/views/events/gitlab/wiki_page/update.blade.php b/resources/views/events/gitlab/wiki_page/update.blade.php index 6ba7779..e03935e 100644 --- a/resources/views/events/gitlab/wiki_page/update.blade.php +++ b/resources/views/events/gitlab/wiki_page/update.blade.php @@ -5,13 +5,11 @@ */ ?> -{!! __('tg-notifier::events/gitlab/wiki_page.title.update', [ - 'repo' => "{$payload->project->path_with_namespace}#{$payload->object_attributes->slug}", - 'user' => "{$payload->user->name}" +πŸ“ {!! __('tg-notifier::events/gitlab/wiki_page.title.update', [ + 'repo' => "🦊{$payload->project->path_with_namespace}#{$payload->object_attributes->slug}", + 'user' => "{$payload->user->name}" ]) !!} -{!! __('tg-notifier::events/gitlab/wiki_page.name', [ - 'name' => "{$payload->object_attributes->title}" - ]) !!} +πŸ“ {!! __('tg-notifier::events/gitlab/wiki_page.name') !!}: {{ $payload->object_attributes->title }} @include('tg-notifier::events.shared.partials.gitlab._body', compact('payload', 'event')) diff --git a/resources/views/events/shared/partials/gitlab/_body.blade.php b/resources/views/events/shared/partials/gitlab/_body.blade.php index fc029b3..ffb0937 100644 --- a/resources/views/events/shared/partials/gitlab/_body.blade.php +++ b/resources/views/events/shared/partials/gitlab/_body.blade.php @@ -19,13 +19,15 @@ } else { return ''; } - if (strlen($body) > 50) { - $body = substr($body, 0, 50) . '...'; + if (strlen($body) > 100) { + $body = substr($body, 0, 100) . '...'; } - $html = __('tg-notifier::events/shared/gitlab._body.title', ['body' => $body]) - ."\n" - .htmlentities($body); + $html = htmlentities($body); } ?> -{!! $html !!} +@if(!empty($html)) +πŸ“– {!! __('tg-notifier::events/shared/gitlab._body.title') !!}: +
{!! $html !!}
+@endif + From 674f05a59773ea32412c60d499780311589c7b92 Mon Sep 17 00:00:00 2001 From: Tan Nguyen Date: Sun, 12 May 2024 03:08:15 +0700 Subject: [PATCH 5/5] fix: update error message translation --- lang/de/app.php | 2 +- lang/en/app.php | 2 +- lang/ja/app.php | 2 +- lang/vi/app.php | 2 +- src/Services/CommandService.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lang/de/app.php b/lang/de/app.php index 0a75f3a..0a803ba 100644 --- a/lang/de/app.php +++ b/lang/de/app.php @@ -3,5 +3,5 @@ return [ 'by' => 'by', 'unknown_callback' => 'Unknown Callback. Something went wrong!', - 'invalid_request' => '🀨 Invalid Request!', + 'invalid_request' => 'Invalid Request!', ]; diff --git a/lang/en/app.php b/lang/en/app.php index 0a75f3a..0a803ba 100644 --- a/lang/en/app.php +++ b/lang/en/app.php @@ -3,5 +3,5 @@ return [ 'by' => 'by', 'unknown_callback' => 'Unknown Callback. Something went wrong!', - 'invalid_request' => '🀨 Invalid Request!', + 'invalid_request' => 'Invalid Request!', ]; diff --git a/lang/ja/app.php b/lang/ja/app.php index 0a75f3a..0a803ba 100644 --- a/lang/ja/app.php +++ b/lang/ja/app.php @@ -3,5 +3,5 @@ return [ 'by' => 'by', 'unknown_callback' => 'Unknown Callback. Something went wrong!', - 'invalid_request' => '🀨 Invalid Request!', + 'invalid_request' => 'Invalid Request!', ]; diff --git a/lang/vi/app.php b/lang/vi/app.php index 6d60ea2..e86c630 100644 --- a/lang/vi/app.php +++ b/lang/vi/app.php @@ -3,5 +3,5 @@ return [ 'by' => 'bởi', 'unknown_callback' => 'Callback khΓ΄ng xΓ‘c Δ‘α»‹nh. Đã xαΊ£y ra lα»—i!', - 'invalid_request' => '🀨 YΓͺu cαΊ§u khΓ΄ng hợp lệ!', + 'invalid_request' => 'YΓͺu cαΊ§u khΓ΄ng hợp lệ!', ]; diff --git a/src/Services/CommandService.php b/src/Services/CommandService.php index 82e9c35..69fb414 100644 --- a/src/Services/CommandService.php +++ b/src/Services/CommandService.php @@ -77,7 +77,7 @@ public function handle(): void break; default: - $this->bot->sendMessage(__('tg-notifier::app.invalid_request')); + $this->bot->sendMessage('🀨 '.__('tg-notifier::app.invalid_request')); } }