Skip to content

Update Structures from Generator #598

Update Structures from Generator

Update Structures from Generator #598

Workflow file for this run

name: Update Structures from Generator
on:
workflow_dispatch:
schedule:
- cron: '0 21 * * *'
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
ini-values: error_reporting=E_ALL
tools: composer:v2
- name: Checkout
uses: actions/checkout@v6
- name: Update Structures
uses: nick-fields/retry@v4
with:
timeout_seconds: 120
max_attempts: 3
command: bash tools/update/update.sh
- name: Get AWS SDK for PHP Version
id: version
run: |
version=$(curl -sL -o - https://raw.githubusercontent.com/sunaoka/aws-sdk-php-structures-generator/refs/heads/main/composer.json | jq -r .require.'"aws/aws-sdk-php"')
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Update composer.json
run: |
composer require aws/aws-sdk-php:"${{ steps.version.outputs.version }}"
- name: Run test suite
run: vendor/bin/phpunit
- name: Commit Files
run: |
version=${{ steps.version.outputs.version }}
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git add .
if git diff --cached --quiet; then
echo "No changes to commit"
exit 0
fi
git commit composer.json src/ -m "Update Structures from AWS SDK for PHP $version" -m "<https://github.com/aws/aws-sdk-php/releases/tag/$version>"
git push
git tag "$version"
git push origin "$version"