-
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (55 loc) · 1.9 KB
/
Copy pathopenapi.yml
File metadata and controls
65 lines (55 loc) · 1.9 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: OpenAPI generate
on:
workflow_dispatch:
push:
branches: [ main, master ]
paths:
- 'upload/api/src/**/*.php'
- 'upload/api/composer.json'
- 'upload/api/composer.lock'
- '.github/workflows/openapi.yml'
- '.github/scripts/fetch-admin-sdk.sh'
- 'upload/api/scripts/**'
permissions:
contents: write
pull-requests: write
jobs:
openapi:
runs-on: ubuntu-latest
defaults:
run:
working-directory: upload/api
steps:
- uses: actions/checkout@v7
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: json, pdo, simplexml
coverage: none
- name: Install dependencies
run: |
rm -rf vendor
composer install --no-dev --no-interaction --prefer-dist --no-progress
- name: Generate openapi.yaml
env:
DLE_ADMIN_SDK: ${{ runner.temp }}/dle-admin-sdk
ADMIN_DOWNLOAD_URL: https://devcraft.club/downloads/devcraft-admin-panel.4/download
ADMIN_ARCHIVE_URL: https://github.com/DevCraftClub/mhadmin/archive/refs/heads/rel/200.4.1.zip
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer openapi
test -s ../../apidata/openapi.yaml
- name: Open PR if spec changed
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'chore(openapi): regenerate openapi.yaml'
branch: chore/openapi-update
delete-branch: true
title: 'chore(openapi): regenerate openapi.yaml'
body: |
Автоматическая регенерация `apidata/openapi.yaml` из PHP-атрибутов.
Модели Schema — из последней версии [DevCraft Admin](https://devcraft.club/downloads/devcraft-admin-panel.4/download).
Триггер: `${{ github.event_name }}`
labels: documentation