jazzsequence / action-validate-plugin-version

A GitHub action that validates the last tested plugin version against the current version of WordPress.
MIT License
0 stars 1 forks source link
github-actions hacktoberfest wordpress wordpress-plugin

Validate WordPress Plugin "Tested Up To" Version

GitHub License Validate Plugin Version Test

A GitHub action that validates the last tested plugin version against the current version of WordPress.

Usage

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
      - 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'

Inputs

plugin-path

The path to the plugin directory to validate. If not specified, the action will use the project root.

dry-run

Only used in self-testing. If passed, this will not actually create a PR against the repository.

gh-token

The GitHub token to use for creating a PR. If not specified, the action will use the default GitHub token.

filenames

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.

branch

The branch to create the PR against. If not specified, the action will use the main branch.

Permissions

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.