Skip to content

Commit

Permalink
Merge pull request #23 from cslant/main
Browse files Browse the repository at this point in the history
Merge new config
  • Loading branch information
tanhongit authored Nov 16, 2023
2 parents f551878 + 1d88e33 commit a531fd5
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 5 deletions.
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,32 @@
# laravel-telegram-git-notify
# 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
```
12 changes: 9 additions & 3 deletions config/telegram-git-notifier.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php

$configFileStorageFolder = storage_path(
env('TGN_CONFIG_FILE_STORAGE_FOLDER', '/app/vendor/tg-notifier/jsons')
);

return [
'defaults' => [
'paths' => [
Expand Down Expand Up @@ -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'
),
],
],
Expand Down
1 change: 0 additions & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ parameters:
paths:
- src
- routes
- config
tmpDir: build/phpstan
checkOctaneCompatibility: true
checkModelProperties: true
Expand Down
5 changes: 5 additions & 0 deletions src/Providers/TelegramGitNotifierServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

/**
Expand Down

0 comments on commit a531fd5

Please sign in to comment.