From 545049a7d6f153ed55238f38f59fa9254126b36e Mon Sep 17 00:00:00 2001 From: Tan Nguyen <35853002+tanhongit@users.noreply.github.com> Date: Mon, 13 Nov 2023 12:04:54 +0700 Subject: [PATCH 1/3] Update README.md --- README.md | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ce5c661..4063d84 100644 --- a/README.md +++ b/README.md @@ -1 +1,32 @@ -# laravel-telegram-git-notify \ No newline at end of file +# Welcome to Telegram GitHub/GitLab Notifier 👋 + +With this package, you can create a Telegram bot to receive notifications from GitHub or GitLab events +and manage customization through messages and buttons on Telegram. + +![License](https://img.shields.io/github/license/cslant/laravel-telegram-git-notifier.svg?style=flat-square) +[![Latest Version](https://img.shields.io/github/release/cslant/laravel-telegram-git-notifier.svg?style=flat-square)](https://github.com/cslant/laravel-telegram-git-notifier/releases) +[![Total Downloads](https://img.shields.io/packagist/dt/cslant/laravel-telegram-git-notifier.svg?style=flat-square)](https://packagist.org/packages/cslant/laravel-telegram-git-notifier) +![Test Status](https://img.shields.io/github/actions/workflow/status/cslant/laravel-telegram-git-notifier/setup_test.yml?label=tests&branch=main) +![Code Style Status](https://img.shields.io/github/actions/workflow/status/cslant/laravel-telegram-git-notifier/php-cs-fixer.yml?label=code%20style&branch=main) +[![StyleCI](https://styleci.io/repos/656960426/shield)](https://styleci.io/repos/656960426) +[![Quality Score](https://img.shields.io/scrutinizer/g/cslant/laravel-telegram-git-notifier.svg?style=flat-square)](https://scrutinizer-ci.com/g/cslant/laravel-telegram-git-notifier) +[![Maintainability](https://api.codeclimate.com/v1/badges/7ccaccebe9cd58ff3df5/maintainability)](https://codeclimate.com/github/cslant/laravel-telegram-git-notifier/maintainability) + +## 📝 Information + +- Send notifications of your GitHub/GitLab repositories to Telegram Bots, Groups, Super Groups (Multiple Topics), and Channels. +- The bot must be created using the [BotFather](https://core.telegram.org/bots#6-botfather) + +## 📋 Requirements + +- PHP ^8.1 +- [Composer](https://getcomposer.org/) +- Core: [Telegram Git Notifier](https://github.com/cslant/telegram-git-notifier) + +## 🔧 Installation + +First, please clone and install this project via [Composer](https://getcomposer.org/): + +```bash +composer require cslant/laravel-telegram-git-notifier +``` From 7079649ac68ea258fa0b4932761d91e246e8769a Mon Sep 17 00:00:00 2001 From: Tan Nguyen Date: Thu, 16 Nov 2023 09:06:21 +0700 Subject: [PATCH 2/3] feat: public config files from core package to storage with provider --- config/telegram-git-notifier.php | 13 ++++++++++--- .../TelegramGitNotifierServiceProvider.php | 5 +++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/config/telegram-git-notifier.php b/config/telegram-git-notifier.php index 050cf7e..8b08290 100644 --- a/config/telegram-git-notifier.php +++ b/config/telegram-git-notifier.php @@ -1,5 +1,10 @@ [ 'paths' => [ @@ -50,19 +55,21 @@ /** Set the path to the data file */ 'data_file' => [ + 'storage_folder' => $configFileStorageFolder, + 'setting' => env( 'TGN_PATH_SETTING', - storage_path('/app/json/tgn/tgn-settings.json') + $configFileStorageFolder.'/tgn-settings.json' ), 'platform' => [ 'gitlab' => env( 'TGN_PATH_PLATFORM_GITLAB', - storage_path('/app/json/tgn/gitlab-events.json') + $configFileStorageFolder.'/gitlab-events.json' ), 'github' => env( 'TGN_PATH_PLATFORM_GITHUB', - storage_path('/app/json/tgn/github-events.json') + $configFileStorageFolder.'/github-events.json' ), ], ], diff --git a/src/Providers/TelegramGitNotifierServiceProvider.php b/src/Providers/TelegramGitNotifierServiceProvider.php index 480baf7..0f3528f 100644 --- a/src/Providers/TelegramGitNotifierServiceProvider.php +++ b/src/Providers/TelegramGitNotifierServiceProvider.php @@ -37,6 +37,11 @@ public function boot(): void $this->publishes([ __DIR__.'/../../lang' => resource_path('lang/vendor/tg-notifier'), ], 'lang'); + + // copy config jsons from core package and ensure permissions are correct + $this->publishes([ + __DIR__.'/../../../telegram-git-notifier/config/jsons' => config('telegram-git-notifier.data_file.storage_folder'), + ], 'config_jsons'); } /** From 7328413f3b85e486d76099abd5fc915c75312b91 Mon Sep 17 00:00:00 2001 From: Tan Nguyen Date: Thu, 16 Nov 2023 09:17:40 +0700 Subject: [PATCH 3/3] fix: change storage path for config file folder --- config/telegram-git-notifier.php | 5 ++--- phpstan.neon.dist | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/config/telegram-git-notifier.php b/config/telegram-git-notifier.php index 8b08290..1920ebb 100644 --- a/config/telegram-git-notifier.php +++ b/config/telegram-git-notifier.php @@ -1,8 +1,7 @@