Skip to content

Generator

Generator #258

Workflow file for this run

name: Generator
on:
workflow_dispatch:
schedule:
- cron: '0 1,7,13,19 * * *'
permissions:
contents: write
pull-requests: write
env:
API_SPEC_MANIFEST: https://toshy.github.io/bunnynet-openapi-specification/manifest.json
jobs:
generate:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
- name: Run map generator
run: php generator/Command/generate-maps.php
- name: Run model generator
run: php generator/Command/generate-models.php --log
- name: Run map generator for possible newly created models
run: php generator/Command/generate-maps.php
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7.0.8
id: cpr
with:
commit-message: Updated API models
title: '[OpenAPI] Updated API models'
body: |
Added/Updated models according to OpenAPI specs.
Checklist:
- [x] Add/Update API models
- [ ] Add/Update documentation examples (when needed)
See [ToshY/bunnynet-openapi-specification][2] for a full changelog of the [OpenAPI specs][1].
[1]: https://toshy.github.io/bunnynet-openapi-specification/manifest.json
[2]: https://github.com/ToshY/bunnynet-openapi-specification/releases
branch: generator/update-api-models
maintainer-can-modify: true
draft: always-true
assignees: ToshY
reviewers: ToshY
delete-branch: true
labels: |
OpenAPI
automated
- name: Show message for created Pull Request
if: ${{ steps.cpr.outputs.pull-request-url && steps.cpr.outputs.pull-request-operation != 'none' }}
shell: bash
env:
PR_URL: ${{ steps.cpr.outputs.pull-request-url }}
PR_OPERATION: ${{ steps.cpr.outputs.pull-request-operation }}
run: |
echo "::notice::${PR_URL} was ${PR_OPERATION}."