Add GitHub Action for automatic framework version updates #1189
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements a complete solution for automatically updating framework versions in response to release webhooks from Yii repositories, addressing issue #272.
Overview
The solution adds a GitHub Action that responds to
repository_dispatch
events and automatically updates theconfig/versions.php
file when new Yii framework releases are published. This eliminates the need for manual version updates and works entirely within GitHub's infrastructure without requiring the website to be running.Implementation Details
Core Workflow (
.github/workflows/update-versions.yml
)repository_dispatch
events with typeyii-release
yiisoft/yii2
→ Yii 2.0 versionsyiisoft/yii
→ Yii 1.1 versionsconfig/versions.php
while preserving exact formattingUpdate Engine (
scripts/update-versions.php
)Helper Tools & Documentation
scripts/trigger-version-update.sh
) for testingdocs/automatic-version-updates.md
) with setup instructions.gitignore
to exclude backup filesUsage
Automatic Operation
Once configured, the workflow automatically triggers when Yii repositories publish new releases by sending a webhook to:
Manual Testing
Repository maintainers can manually trigger updates using the provided script:
Safety Features
Example Update
When a new Yii 2.0.54 release is published, the workflow automatically adds:
This solution provides a robust, zero-maintenance approach to keeping framework version information current, directly addressing the automation needs outlined in issue #272.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
asset-packagist.org
/usr/bin/php8.3 -n -c /tmp/xwSzNj /usr/bin/composer update --no-dev
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.