Automatically update your alleyinteractive/create-wordpress-plugin-based plugins to the latest WordPress version whenever core releases a new version.
When a new version of WordPress is released, this action will automatically bump
the Tested up to version of the plugin. You can also run the packages-update
npm
script
to update the WordPress plugin dependencies to match the latest WordPress version.
By default, the plugin will look for a plugin.php file in the root of the
repository. If your plugin's main file is named something else, you can specify
the name of the file using the plugin-file input.
name: Update WordPress Plugin
on:
pull_request:
schedule:
- cron: '0 */6 * * *'
permissions:
contents: write
pull-requests: write
jobs:
update-plugin:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: alleyinteractive/action-update-wordpress-plugin@v2
with:
plugin-file: 'plugin.php'
upgrade-npm-dependencies: "true"
node-version: '20' # Specify the Node.js version if not lts/*
The action assumes that a package-lock.json file exists in the root of the
repository to run npm ci.
When one or more open pull requests created by this action already exist, the action updates the newest pull request's branch, title, and checklist instead of opening another pull request. It also comments on the pull request with the previous and new WordPress versions. Closed and merged pull requests are not reused.
plugin-file- The name of the plugin's main file. Defaults toplugin.php.upgrade-npm-dependencies- Whether or not to run thepackages-updatenpm script. Defaults to"true". Set to"false"to disable, which also skips the Node.js setup step entirely.node-version- The version of Node.js to use for running the action. Defaults to"lts/*". Specify any version number or tag supported byactions/setup-node(e.g.,18,20,lts/*,lts/jod,latest). A bareltsis not valid syntax forsetup-node; the action rewrites it tolts/*and logs a warning rather than failing.
The v2 tag always points at the newest 2.x release, so @v2 picks up fixes
automatically. Pin an exact tag such as @v2.1.0 if you would rather review
each upgrade yourself.
actions/setup-node@v7 requires an Actions runner on version 2.327.1 or later.
All GitHub-hosted runners meet this; self-hosted runners may need updating.
See CHANGELOG.md for a list of changes in each release.
This project is actively maintained by Alley Interactive. Like what you see? Come work with us.
The GNU General Public License (GPL) license. Please see License File for more information.