Update bot API #356
This file contains hidden or 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
| on: | |
| workflow_dispatch: {} | |
| schedule: | |
| - cron: '0 0 * * *' | |
| name: Update bot API | |
| jobs: | |
| scrap-and-generate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Composer dependencies | |
| uses: php-actions/composer@v6 | |
| with: | |
| php_version: 8.2 | |
| - name: Scrap API docs | |
| run: composer run scrap | |
| - name: Check if updated | |
| id: check_api | |
| run: | | |
| if git diff --quiet --exit-code api.json; then | |
| echo "api_changed=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "api_changed=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Run generate command | |
| if: steps.check_api.outputs.api_changed == 'true' | |
| run: | | |
| composer run generate | |
| vendor/bin/pint | |
| vendor/bin/rector | |
| - name: Create Pull Request | |
| if: steps.check_api.outputs.api_changed == 'true' | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| commit-message: "[auto] update telegram bot API" | |
| branch: auto/api-update | |
| title: "[AUTO] Update Telegram Bot API" | |
| body: "This pull request was automatically generated by the GitHub Actions workflow." |