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