Skip to content

Code Generation Pull Request #134

Code Generation Pull Request

Code Generation Pull Request #134

name: Code Generation Pull Request
on:
workflow_dispatch:
jobs:
createPullRequest:
name: Code Generation Pull Request
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- name: Clean old files
run: |
rm -rf .openapi-generator Api Controller DependencyInjection Model Resources Service Tests
rm -rf .coveralls.yml autoload.php git_push.sh OpenAPIServerBundle.php openapitools.json phpunit.xml.dist pom.xml README.md
- name: Open API code generation
run: |
npm install @openapitools/openapi-generator-cli
npx @openapitools/openapi-generator-cli version-manager set 7.5.0
npx @openapitools/openapi-generator-cli generate -i catroweb.yaml -g php-symfony -p sortParamsByRequiredFlag=true -p skipFormModel=true -p variableNamingConvention=snake_case -p phpLegacySupport=false -o .
- name: Permissions
run: sudo chmod -R 777 ./
- name: Fix code style
uses: docker://oskarstark/php-cs-fixer-ga:latest
with:
args: --allow-risky=yes
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Automated Code Generation
committer: Catrobot <[email protected]>
title: 'Bump autogenerated OpenAPI code'
body: |
Automatic Open API Code Generation
This pull request is autogenerated using the latest catroweb.yml swagger specificatons.
- removes old autogenerated files
- run open API generator (Symfony-Php)
- fix code style (Php-cs-fixer)
For more information checkout the action '.github/workflows/create_pull_request.yml'
labels: automated, open-api-generator, php-cs-fixer
branch-suffix: timestamp
delete-branch: true
- name: Check outputs
run: |
echo "Pull Request Number - ${{ env.PULL_REQUEST_NUMBER }}"
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"