File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Update OpenAPI JSON
2+
3+ on :
4+ push :
5+ paths :
6+ - ' app/Http/Controllers/Api/**/*.php'
7+ - ' app/OpenApi/**/*.php'
8+
9+ jobs :
10+ update-openapi :
11+ runs-on : ubuntu-24.04
12+
13+ steps :
14+ - name : Checkout repository
15+ uses : actions/checkout@v4
16+ with :
17+ ref : ${{ github.event.pull_request.head.ref }}
18+ repository : ${{ github.event.pull_request.head.repo.full_name }}
19+
20+ - name : Set up PHP
21+ uses : shivammathur/setup-php@v2
22+ with :
23+ php-version : ' 8.3'
24+
25+ - name : Install dependencies
26+ run : composer install -q --no-ansi --no-interaction --no-scripts --no-progress
27+
28+ - name : Generate OpenAPI JSON
29+ run : ./vendor/bin/openapi app -o openapi_temp.json -f json
30+
31+ - name : Commit OpenAPI JSON if changed
32+ run : |
33+ if ! diff -q openapi.json openapi_temp.json; then
34+ mv openapi_temp.json openapi.json
35+ git config user.name "GitHub Action"
36+ git config user.email "[email protected] " 37+ git add openapi.json
38+ git commit -m "Update OpenAPI JSON"
39+ git push
40+ fi
You can’t perform that action at this time.
0 commit comments