Skip to content

Commit 2712c6e

Browse files
committed
ci(workflows): add Packagist webhook trigger and adjust test job
- Add `.github/workflows/packagist-webhook.yml` to support manual Packagist API updates - Rename main job from `build` to `test` in `php.yml` for clarity - Set `include-hidden-files: false` when uploading PHPUnit report
1 parent 58a4c02 commit 2712c6e

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Notify Packagist
3+
4+
on:
5+
push:
6+
branches: [ "main","develop","tests" ]
7+
8+
jobs:
9+
notify:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Read package name from composer.json
17+
id: composer
18+
run: |
19+
PACKAGE_NAME=$(jq -r .name composer.json)
20+
echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_OUTPUT
21+
22+
- name: Notify Packagist
23+
run: |
24+
curl -s -X POST \
25+
-H "Content-Type: application/json" \
26+
-d "{\"repository\": {\"url\": \"https://packagist.org/packages/${{ steps.composer.outputs.PACKAGE_NAME }}\"}}" \
27+
"https://packagist.org/api/update-package?username=${{ secrets.PACKAGIST_USERNAME }}&apiToken=${{ secrets.PACKAGIST_TOKEN }}"

.github/workflows/php.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: PHP Composer
23

34
on:
@@ -10,7 +11,7 @@ permissions:
1011
contents: read
1112

1213
jobs:
13-
build:
14+
test:
1415

1516
runs-on: ubuntu-latest
1617

@@ -44,3 +45,4 @@ jobs:
4445
with:
4546
name: phpunit-report
4647
path: .phpunit.junit.xml
48+
include-hidden-files: false

0 commit comments

Comments
 (0)