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 +``` diff --git a/config/telegram-git-notifier.php b/config/telegram-git-notifier.php index 050cf7e..1920ebb 100644 --- a/config/telegram-git-notifier.php +++ b/config/telegram-git-notifier.php @@ -1,5 +1,9 @@ [ 'paths' => [ @@ -50,19 +54,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/phpstan.neon.dist b/phpstan.neon.dist index f31d56b..dba5a52 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -6,7 +6,6 @@ parameters: paths: - src - routes - - config tmpDir: build/phpstan checkOctaneCompatibility: true checkModelProperties: true 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'); } /**