Skip to content

Commit a531fd5

Browse files
authored
Merge pull request #23 from cslant/main
Merge new config
2 parents f551878 + 1d88e33 commit a531fd5

File tree

4 files changed

+46
-5
lines changed

4 files changed

+46
-5
lines changed

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,32 @@
1-
# laravel-telegram-git-notify
1+
# Welcome to Telegram GitHub/GitLab Notifier 👋
2+
3+
With this package, you can create a Telegram bot to receive notifications from GitHub or GitLab events
4+
and manage customization through messages and buttons on Telegram.
5+
6+
![License](https://img.shields.io/github/license/cslant/laravel-telegram-git-notifier.svg?style=flat-square)
7+
[![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)
8+
[![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)
9+
![Test Status](https://img.shields.io/github/actions/workflow/status/cslant/laravel-telegram-git-notifier/setup_test.yml?label=tests&branch=main)
10+
![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)
11+
[![StyleCI](https://styleci.io/repos/656960426/shield)](https://styleci.io/repos/656960426)
12+
[![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)
13+
[![Maintainability](https://api.codeclimate.com/v1/badges/7ccaccebe9cd58ff3df5/maintainability)](https://codeclimate.com/github/cslant/laravel-telegram-git-notifier/maintainability)
14+
15+
## 📝 Information
16+
17+
- Send notifications of your GitHub/GitLab repositories to Telegram Bots, Groups, Super Groups (Multiple Topics), and Channels.
18+
- The bot must be created using the [BotFather](https://core.telegram.org/bots#6-botfather)
19+
20+
## 📋 Requirements
21+
22+
- PHP ^8.1
23+
- [Composer](https://getcomposer.org/)
24+
- Core: [Telegram Git Notifier](https://github.com/cslant/telegram-git-notifier)
25+
26+
## 🔧 Installation
27+
28+
First, please clone and install this project via [Composer](https://getcomposer.org/):
29+
30+
```bash
31+
composer require cslant/laravel-telegram-git-notifier
32+
```

config/telegram-git-notifier.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<?php
22

3+
$configFileStorageFolder = storage_path(
4+
env('TGN_CONFIG_FILE_STORAGE_FOLDER', '/app/vendor/tg-notifier/jsons')
5+
);
6+
37
return [
48
'defaults' => [
59
'paths' => [
@@ -50,19 +54,21 @@
5054

5155
/** Set the path to the data file */
5256
'data_file' => [
57+
'storage_folder' => $configFileStorageFolder,
58+
5359
'setting' => env(
5460
'TGN_PATH_SETTING',
55-
storage_path('/app/json/tgn/tgn-settings.json')
61+
$configFileStorageFolder.'/tgn-settings.json'
5662
),
5763

5864
'platform' => [
5965
'gitlab' => env(
6066
'TGN_PATH_PLATFORM_GITLAB',
61-
storage_path('/app/json/tgn/gitlab-events.json')
67+
$configFileStorageFolder.'/gitlab-events.json'
6268
),
6369
'github' => env(
6470
'TGN_PATH_PLATFORM_GITHUB',
65-
storage_path('/app/json/tgn/github-events.json')
71+
$configFileStorageFolder.'/github-events.json'
6672
),
6773
],
6874
],

phpstan.neon.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ parameters:
66
paths:
77
- src
88
- routes
9-
- config
109
tmpDir: build/phpstan
1110
checkOctaneCompatibility: true
1211
checkModelProperties: true

src/Providers/TelegramGitNotifierServiceProvider.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ public function boot(): void
3737
$this->publishes([
3838
__DIR__.'/../../lang' => resource_path('lang/vendor/tg-notifier'),
3939
], 'lang');
40+
41+
// copy config jsons from core package and ensure permissions are correct
42+
$this->publishes([
43+
__DIR__.'/../../../telegram-git-notifier/config/jsons' => config('telegram-git-notifier.data_file.storage_folder'),
44+
], 'config_jsons');
4045
}
4146

4247
/**

0 commit comments

Comments
 (0)