Watch for changes #1690
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: Watch for changes | |
on: | |
schedule: | |
- cron: "0 6 * * *" | |
workflow_dispatch: ~ | |
jobs: | |
generated-code: | |
if: github.repository == 'async-aws/aws' | |
name: Assert Generated Code is uptodate with last version | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.1 | |
coverage: none | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: master | |
- name: Get composer cache directory | |
id: composer-cache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache Composer | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: composer-${{ github.sha }} | |
restore-keys: composer- | |
- name: Download dependencies | |
run: | | |
composer update --no-interaction --prefer-dist --optimize-autoloader --prefer-stable | |
- name: Cache PhpCsFixer | |
uses: actions/cache@v3 | |
with: | |
path: | | |
.cache/php-cs-fixer/ | |
.cache/generate/ | |
key: generate-${{ github.sha }} | |
restore-keys: generate- | |
- name: Regenerate code against last version | |
id: fetch_version | |
run: | | |
.github/workflows/bin/refresh | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
token: ${{ secrets.BOT_GITHUB_TOKEN }} | |
push-to-fork: async-aws-bot/aws | |
author: AsyncAws Bot <[email protected]> | |
committer: AsyncAws Bot <[email protected]> | |
commit-message: update generated code | |
title: Update generated code | |
body: | | |
The AWS API contract changed with version ${{ steps.fetch_version.outputs.last }}. | |
This PR contains the new definition for Services. | |
branch: bot-code-update |