Skip to content

Commit a564294

Browse files
authored
Merge pull request #60 from tanhongit/develop
Develop
2 parents 42c0991 + 2d01ee2 commit a564294

File tree

4 files changed

+63
-14
lines changed

4 files changed

+63
-14
lines changed

README.md

+46-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616

1717
## 📝 Introduction
1818

19-
Laravel Telegram Git Notifier is a package that allows you to create a Telegram bot to receive notifications from GitHub or GitLab events and manage customization through messages and buttons on Telegram.
19+
Laravel Telegram Git Notifier is a package that allows you to create a Telegram bot to receive notifications from GitHub
20+
or GitLab events and manage customization through messages and buttons on Telegram.
2021

21-
- Send notifications of your GitHub/GitLab repositories to Telegram Bots, Groups, Super Groups (Multiple Topics), and Channels.
22+
- Send notifications of your GitHub/GitLab repositories to Telegram Bots, Groups, Super Groups (Multiple Topics), and
23+
Channels.
2224
- The bot must be created using the [BotFather](https://core.telegram.org/bots#6-botfather)
2325

2426
## 📋 Requirements
@@ -35,11 +37,52 @@ You can install this package via Composer:
3537
composer require cslant/laravel-telegram-git-notifier
3638
```
3739

40+
## 🚀 Usage
41+
42+
See the [Usage - Telegram git notifier Documentation](https://docs.cslant.com/telegram-git-notifier/usage/first_test)
43+
for a list of usage.
44+
3845
Please check and update some configurations in the documentation.
3946

4047
## 📖 Official Documentation
4148

42-
Please see the [Telegram Git Notifier Documentation](https://docs.cslant.com/telegram-git-notifier/) for more information.
49+
Please see the [Telegram Git Notifier Documentation](https://docs.cslant.com/telegram-git-notifier/) for more
50+
information.
51+
52+
## ✨ Supported events
53+
54+
### GitHub Events Available
55+
56+
- [x] Push
57+
- [x] Issues
58+
- [x] Issue Comment
59+
- [x] Pull Request
60+
- [x] Pull Request Review
61+
- [x] Pull Request Review Comment
62+
- [x] Fork
63+
- [x] Commit Comment
64+
- [x] Deployment
65+
- [x] Deployment Status
66+
- [x] Fork
67+
- [x] Gollum
68+
- [x] Watch
69+
70+
... and more events can be seen in the [all GitHub events available](https://docs.cslant.com/telegram-git-notifier/prologue/event-availability/github)
71+
72+
### GitLab Events Available
73+
74+
- [x] Push
75+
- [x] Tag Push
76+
- [x] Issue
77+
- [x] Merge Request
78+
- [x] Note
79+
- [x] Pipeline
80+
- [x] Wiki Page
81+
- [x] Build
82+
- [x] Deployment
83+
- [x] Release
84+
85+
... and more events can be seen in the [all GitLab events available](https://docs.cslant.com/telegram-git-notifier//prologue/event-availability/gitlab)
4386

4487
## License
4588

composer.json

+1-7
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,7 @@
5151
},
5252
"scripts": {
5353
"analyse": "vendor/bin/phpstan analyse",
54-
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes",
55-
"post-install-cmd": [
56-
"bash vendor/cslant/telegram-git-notifier/install.sh"
57-
],
58-
"post-update-cmd": [
59-
"bash vendor/cslant/telegram-git-notifier/install.sh"
60-
]
54+
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes"
6155
},
6256
"support": {
6357
"issues": "https://github.com/cslant/laravel-telegram-git-notifier/issues"

resources/views/tools/custom_event.blade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
$docsUrl = 'https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads';
77
if ($platform === 'gitlab') {
8-
$docsUrl = 'https://docs.gitlab.com/ee/user/project/integrations/webhooks.html';
8+
$docsUrl = 'https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html';
99
}
1010
$documentation = __('tg-notifier::tools/custom_event.documentation');
1111
?>

src/Commands/ChangeOwnerConfigJson.php

+15-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ChangeOwnerConfigJson extends Command
1212
* @var string
1313
*/
1414
protected $signature = 'config-json:change-owner
15-
{user : The user to change owner}
15+
{user? : The user to change owner}
1616
{group? : The group to change owner}';
1717

1818
/**
@@ -29,12 +29,24 @@ class ChangeOwnerConfigJson extends Command
2929
*/
3030
public function handle(): void
3131
{
32-
$user = $this->argument('user');
32+
if (PHP_OS_FAMILY !== 'Linux') {
33+
$this->error('This command only works on Linux');
34+
35+
return;
36+
}
37+
38+
$user = $this->argument('user') ?? '';
3339
$group = $this->argument('group') ?? $user;
3440

41+
if (empty($user) || empty($group)) {
42+
$group = $user = exec('ps aux | egrep "(apache|httpd|nginx)" | grep -v "root" | head -n1 | cut -d\ -f1');
43+
}
44+
3545
$jsonsPath = config('telegram-git-notifier.data_file.storage_folder');
3646
if (is_string($jsonsPath) && file_exists($jsonsPath)) {
37-
exec("chown -R $user:$group $jsonsPath");
47+
shell_exec("chown -R $user:$group $jsonsPath");
48+
} else {
49+
$this->error('The path to the jsons folder is not valid');
3850
}
3951
}
4052
}

0 commit comments

Comments
 (0)