Skip to content

Commit 4c766d0

Browse files
authored
Merge pull request #16 from tanhongit/develop
Develop
2 parents 48be0fc + a7ce285 commit 4c766d0

File tree

12 files changed

+169
-26
lines changed

12 files changed

+169
-26
lines changed

.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
; This is the top-most EditorConfig file, which is not inherited by any other files.
2+
; This file is used for unify the coding style for different editors and IDEs.
3+
; More information at https://editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
charset = utf-8
9+
end_of_line = lf
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.yml]
15+
indent_style = space
16+
17+
[*.json]
18+
indent_style = space
19+
indent_size = 2

.github/workflows/php-cs-fixer.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Check & fix styling
2+
3+
on: [push]
4+
5+
permissions:
6+
contents: write
7+
8+
jobs:
9+
php-cs-fixer:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
with:
16+
ref: ${{ github.head_ref }}
17+
18+
- name: Run PHP CS Fixer
19+
uses: docker://oskarstark/php-cs-fixer-ga
20+
with:
21+
args: --config=.php-cs-fixer.dist.php --allow-risky=yes
22+
23+
- name: Commit changes
24+
uses: stefanzweifel/git-auto-commit-action@v5
25+
with:
26+
commit_message: Fix styling

.github/workflows/setup_test.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,34 @@
1-
name: Setup and test
1+
name: Setup & test
22

33
on: [ push, pull_request ]
44

55
jobs:
66
tests:
7-
name: Setup and run tests
8-
runs-on: ubuntu-latest
7+
name: Composer P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.os }}
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
os: [ ubuntu-latest ]
12+
php: [ '8.1', '8.2' ]
13+
laravel: [ 10.*, 9.* ]
14+
include:
15+
- laravel: 10.*
16+
testbench: 8.*
17+
- laravel: 9.*
18+
testbench: 8.*
919
steps:
1020
- name: Setup PHP
1121
uses: shivammathur/setup-php@v2
1222
with:
13-
php-version: '8.2'
23+
php-version: ${{ matrix.php }}
24+
1425
- name: Checkout code
15-
uses: actions/checkout@v3
26+
uses: actions/checkout@v4
27+
1628
- name: Install dependencies
1729
run: |
1830
composer install --no-interaction --no-progress --no-suggest
31+
1932
- name: Run tests
2033
run: |
2134
composer validate --strict
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Update Changelog
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
update:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
with:
18+
ref: main
19+
20+
- name: Update Changelog
21+
uses: stefanzweifel/changelog-updater-action@v1
22+
with:
23+
latest-version: ${{ github.event.release.name }}
24+
release-notes: ${{ github.event.release.body }}
25+
26+
- name: Commit updated CHANGELOG
27+
uses: stefanzweifel/git-auto-commit-action@v5
28+
with:
29+
branch: main
30+
commit_message: Update CHANGELOG
31+
file_pattern: CHANGELOG.md

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,7 @@ npm-debug.log
2828

2929
package-lock.json
3030
yarn.lock
31-
/.sass-cache
31+
/.sass-cache
32+
33+
build
34+
.php-cs-fixer.cache

.php-cs-fixer.dist.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
$finder = Symfony\Component\Finder\Finder::create()
4+
->in([
5+
__DIR__ . '/src',
6+
__DIR__ . '/tests',
7+
])
8+
->name('*.php')
9+
->ignoreDotFiles(true)
10+
->ignoreVCS(true);
11+
12+
return (new PhpCsFixer\Config())
13+
->setRules([
14+
'@PSR12' => true,
15+
'array_syntax' => ['syntax' => 'short'],
16+
'ordered_imports' => ['sort_algorithm' => 'alpha'],
17+
'no_unused_imports' => true,
18+
'trailing_comma_in_multiline' => true,
19+
'phpdoc_scalar' => true,
20+
'unary_operator_spaces' => true,
21+
'binary_operator_spaces' => true,
22+
'blank_line_before_statement' => [
23+
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
24+
],
25+
'phpdoc_single_line_var_spacing' => true,
26+
'phpdoc_var_without_name' => true,
27+
'class_attributes_separation' => [
28+
'elements' => [
29+
'method' => 'one',
30+
],
31+
],
32+
'method_argument_space' => [
33+
'on_multiline' => 'ensure_fully_multiline',
34+
'keep_multiple_spaces_after_comma' => true,
35+
],
36+
'single_trait_insert_per_statement' => true,
37+
])
38+
->setFinder($finder);

composer.json

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "lbiltech/laravel-telegram-git-notifier",
2+
"name": "cslant/laravel-telegram-git-notifier",
33
"description": "Send notification from Gitlab and Github events to Telegram",
44
"keywords": [
5-
"lbiltech",
5+
"cslant",
66
"telegram-bot",
77
"notify",
88
"git-webhook",
@@ -15,7 +15,7 @@
1515
"telegram-bot-github-notify",
1616
"telegram-bot-gitlab-notify"
1717
],
18-
"homepage": "https://github.com/lbiltech/laravel-telegram-git-notifier",
18+
"homepage": "https://github.com/cslant/laravel-telegram-git-notifier",
1919
"license": "MIT",
2020
"authors": [
2121
{
@@ -32,34 +32,47 @@
3232
],
3333
"autoload": {
3434
"psr-4": {
35-
"LbilTech\\LaravelTelegramGitNotifier\\": "src/"
35+
"CSlant\\LaravelTelegramGitNotifier\\": "src/"
3636
}
3737
},
3838
"autoload-dev": {
3939
"psr-4": {
40-
"LbilTech\\LaravelTelegramGitNotifier\\Tests\\": "tests/"
40+
"CSlant\\LaravelTelegramGitNotifier\\Tests\\": "tests/"
4141
}
4242
},
4343
"require": {
44-
"php": "^8.0",
45-
"lbiltech/telegram-git-notifier": "dev-main"
44+
"php": "^8.1",
45+
"cslant/telegram-git-notifier": "^v1.3.1"
4646
},
4747
"require-dev": {
48-
"phpunit/phpunit": "^9.5|^10.0",
49-
"mockery/mockery": "^1.6"
48+
"friendsofphp/php-cs-fixer": "^v3.37.1",
49+
"pestphp/pest": "^2.24",
50+
"phpstan/phpstan": "^1.10.39"
51+
},
52+
"scripts": {
53+
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes",
54+
"post-install-cmd": [
55+
"bash vendor/cslant/telegram-git-notifier/install.sh"
56+
],
57+
"post-update-cmd": [
58+
"bash vendor/cslant/telegram-git-notifier/install.sh"
59+
]
5060
},
5161
"support": {
52-
"issues": "https://github.com/lbiltech/laravel-telegram-git-notifier/issues"
62+
"issues": "https://github.com/cslant/laravel-telegram-git-notifier/issues"
5363
},
5464
"extra": {
5565
"laravel": {
5666
"providers": [
57-
"LbilTech\\LaravelTelegramGitNotifier\\Providers\\TelegramGitNotifierServiceProvider"
67+
"CSlant\\LaravelTelegramGitNotifier\\Providers\\TelegramGitNotifierServiceProvider"
5868
]
5969
}
6070
},
6171
"config": {
62-
"sort-packages": true
72+
"sort-packages": true,
73+
"allow-plugins": {
74+
"pestphp/pest-plugin": true
75+
}
6376
},
6477
"minimum-stability": "dev",
6578
"prefer-stable": true

config/telegram-git-notifier.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131
'author' => [
3232
'discussion' => env(
3333
'TGN_AUTHOR_DISCUSSION',
34-
'https://github.com/lbiltech/laravel-telegram-git-notifier/discussions'
34+
'https://github.com/cslant/laravel-telegram-git-notifier/discussions'
3535
),
3636
'source_code' => env(
3737
'TGN_AUTHOR_SOURCE_CODE',
38-
'https://github.com/lbiltech/laravel-telegram-git-notifier'
38+
'https://github.com/cslant/laravel-telegram-git-notifier'
3939
),
4040
],
4141

phpunit.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
</include>
1414
</coverage>
1515
<testsuites>
16-
<testsuite name="LbilTech Laravel Telegram Git Notify">
16+
<testsuite name="CSlant Laravel Telegram Git Notifier">
1717
<directory>tests</directory>
1818
</testsuite>
1919
</testsuites>
20-
</phpunit>
20+
</phpunit>

routes/bot.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

3+
use CSlant\LaravelTelegramGitNotifier\Http\Actions\WebhookAction;
34
use Illuminate\Support\Facades\Route;
4-
use LbilTech\LaravelTelegramGitNotifier\Http\Actions\WebhookAction;
55

66
/*
77
|--------------------------------------------------------------------------

0 commit comments

Comments
 (0)