Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge new config #23

Merged
merged 4 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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([
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public config JSON files

__DIR__.'/../../../telegram-git-notifier/config/jsons' => config('telegram-git-notifier.data_file.storage_folder'),
], 'config_jsons');
}

/**
Expand Down