forked from alexjustesen/speedtest-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (33 loc) · 1.05 KB
/
update-openapi.yml
File metadata and controls
40 lines (33 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Update OpenAPI JSON
on:
push:
paths:
- 'app/Http/Controllers/Api/**/*.php'
- 'app/OpenApi/**/*.php'
jobs:
update-openapi:
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
- name: Install dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress
- name: Generate OpenAPI JSON
run: ./vendor/bin/openapi app -o openapi_temp.json -f json
- name: Commit OpenAPI JSON if changed
run: |
if ! diff -q openapi.json openapi_temp.json; then
mv openapi_temp.json openapi.json
git config user.name "GitHub Action"
git config user.email "actions@github.com"
git add openapi.json
git commit -m "Update OpenAPI JSON"
git push
fi