-
Notifications
You must be signed in to change notification settings - Fork 213
Determine WordPress and WooCommerce plugin versions dynamically via GitHub Actions #4289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
daledupreez
merged 20 commits into
develop
from
try/add-action-to-fetch-wp-plugin-versions
May 19, 2025
Merged
Determine WordPress and WooCommerce plugin versions dynamically via GitHub Actions #4289
daledupreez
merged 20 commits into
develop
from
try/add-action-to-fetch-wp-plugin-versions
May 19, 2025
Conversation
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
annemirasol
approved these changes
May 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good! 🚢
If we plan to publish broadly, we should probably sanitize plugin-slug
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
type: task
The issue is an internally driven task (e.g. from another A8c team).
type: technical debt
This issue/PR represents/solves the technical debt of the project.
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.
Changes proposed in this Pull Request:
While working on some tests, I noticed that our unit test matrix for WordPress is currently missing 6.8 (and had 6.6 duplicated due to WooCommerce <-> WordPress compatibility), and we also haven't picked up the most recent minor release of WooCommerce. I then spent some time exploring whether we could automate building the most recent versions using GitHub Actions, and put together the actions in this PR to get the n most recent releases of WordPress and any specified plugin, and then wired them into our PHP unit test testing matrix.
As a side effect, we've added WordPress
6.8.1
instead of6.6
, and we picked up the recent WooCommerce patch release.It's possible that both actions will be useful to more folks in the WordPress community, so I plan to kick off a discussion about publishing these actions for broader internal use.
Implementation notes
The approach for both actions is fairly similar:
api.wordpress.org
to get (WordPress releases | plugin details) in JSON formatjq
to filter that down to a list of releases, and filter out suffixed releases, e.g.-beta
,-rc1
etcjq
to group bymajor.minor
version, and then pick only the most recent release for eachmajor.minor
version, e.g. we group WordPress6.7.2
,6.7.1
, and6.7.0
, but we then filter down to6.7.2
The one minor difference (for now) is that the WordPress list uses an hourly file cache. That may or may not be something that makes sense in the long run.
Testing instructions
The new actions and their wiring are already in place!
PHP tests / get-wordpress-versions
log in the tests below, and verify that the logs show us fetching the most recent WordPress versionsPHP tests / get-woocommerce-versions
log in the tests below, and verify that the logs show us fetching the set of recent WooCommerce releasesPHP tests / Stable *
logs to verify that we're running with the right versions ofChangelog entry
Changelog Entry Comment
Comment
Post merge