A GitHub action that validates the last tested plugin version against the current version of WordPress.
name: Validate Plugin Version
on:
schedule:
- cron: '0 0 * * 0'
permissions:
contents: write
pull-requests: write
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Validate Plugin Version
uses: jazzsequence/action-validate-plugin-version@v1
with:
plugin-path: 'path/to/plugin-slug/'
filenames: 'readme.txt,README.MD'
branch: 'main'
Your actions/checkout
action must include fetch-depth
. fetch-depth: 0
ensures that all branches are pulled which is necessary for ensuring that the correct branch is used to create the pull request against.
The path to the plugin directory to validate. If not specified, the action will use the project root.
Only used in self-testing. If passed, this will not actually create a PR against the repository.
The GitHub token to use for creating a PR. If not specified, the action will use the default GitHub token.
A comma-separated list of filenames to check for the "Tested Up To" version. If not specified, the action will use readme.txt
and README.md
.
The branch to create the PR against. If not specified, the action will use the main
branch.
The write
permissions on contents
and pull-requests
are important. They are required for the action to commit the changes back to the repository and open a pull request. The only files affected by the action are files named readme.txt
, README.md
or those files matching the pattern (looking for "Tested Up To" in the file) that have been specified in the filenames
input.