Skip to content

Commit cd3ffec

Browse files
committed
Add Github Actions to build openapi.json
1 parent 1bb451d commit cd3ffec

1 file changed

Lines changed: 85 additions & 0 deletions

File tree

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Generate OpenAPI Specification
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- 'config/api.yml'
9+
- 'lib/manageiq/api/open_api/**'
10+
- 'app/controllers/api/**'
11+
schedule:
12+
- cron: 0 0 * * 0
13+
workflow_dispatch:
14+
concurrency:
15+
group: "${{ github.workflow }}-${{ github.ref }}"
16+
cancel-in-progress: true
17+
permissions:
18+
contents: read
19+
jobs:
20+
openapi-generate:
21+
runs-on: ubuntu-latest
22+
services:
23+
postgres:
24+
image: manageiq/postgresql:13
25+
env:
26+
POSTGRESQL_USER: root
27+
POSTGRESQL_PASSWORD: smartvm
28+
POSTGRESQL_DATABASE: vmdb_test
29+
options: "--health-cmd pg_isready --health-interval 2s --health-timeout 5s --health-retries 5"
30+
ports:
31+
- 5432:5432
32+
env:
33+
PGHOST: localhost
34+
PGPASSWORD: smartvm
35+
RAILS_ENV: test
36+
steps:
37+
- name: Checkout repository
38+
uses: actions/checkout@v6
39+
- name: Set up system
40+
run: bin/before_install
41+
- name: Set up Ruby
42+
uses: ruby/setup-ruby@v1
43+
with:
44+
ruby-version: '3.3'
45+
bundler-cache: true
46+
timeout-minutes: 30
47+
- name: Prepare tests
48+
run: bin/setup
49+
- name: Generate OpenAPI specification
50+
run: bundle exec rake manageiq:api:openapi_generate
51+
- name: Create Pull Request
52+
uses: peter-evans/create-pull-request@v8
53+
with:
54+
token: ${{ secrets.GITHUB_TOKEN }}
55+
commit-message: "Update OpenAPI specification"
56+
title: "Update OpenAPI specification"
57+
body: |
58+
## OpenAPI Specification Update
59+
60+
This PR updates the OpenAPI specification (`config/openapi.json`) based on the current API configuration.
61+
62+
### Changes
63+
- Regenerated OpenAPI spec from `config/api.yml`
64+
- Updated schemas, paths, and operations
65+
66+
### Generated by
67+
- Workflow: `${{ github.workflow }}`
68+
- Run: `${{ github.run_number }}`
69+
- Triggered by: `${{ github.workflow_ref }}\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}`
70+
71+
### Review Checklist
72+
- [ ] Verify new/modified endpoints are documented correctly
73+
- [ ] Check parameter definitions are accurate
74+
- [ ] Ensure response schemas match actual API responses
75+
- [ ] Validate security schemes are properly defined
76+
77+
---
78+
*This PR was automatically generated by GitHub Actions*
79+
branch: openapi_generate
80+
delete-branch: true
81+
push-to-fork: miq-bot/manageiq-api
82+
labels: |
83+
enhancement
84+
add-paths: |
85+
config/openapi.json

0 commit comments

Comments
 (0)