Code Generation Pull Request #137
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.2' | |
- name: Install dependencies | |
run: composer install --no-progress --no-suggest --prefer-dist | |
- name: Run Rector | |
run: vendor/bin/rector | |
- name: Fix code style | |
run: vendor/bin/php-cs-fixer fix | |
- 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 }}" |