Skip to content

AlecRust/wp-tut-updater-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

WordPress "Tested up to" Updater

Lint CI CodeQL Check Transpiled JS

This GitHub Action updates the "Tested up to" version in WordPress plugins or themes if it doesn't match the latest version of WordPress.

It can create a pull request for the change, or commit directly to the default branch. Never forget to update your "Tested up to" version again!

Example

Here's a minimal example running the action based on a cron schedule. It will create a pull request by default.

.github/workflows/tut-check.yml:

on:
  schedule:
    - cron: '0 0 * * 0'
  workflow_dispatch:

permissions:
  contents: write
  pull-requests: write

jobs:
  update-tested-up-to:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Update "Tested up to" version
        uses: AlecRust/wp-tut-updater-action@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Please note:

  • permissions section is always required in your workflow for the action to write to the repository
  • "Allow GitHub Actions to create and approve pull requests" setting is required to create pull requests
  • The pull request author is set by GITHUB_TOKEN which unless overridden will be the GitHub Actions bot user

Usage

See action.yml for detailed information on the action's inputs.

- uses: AlecRust/wp-tut-updater-action@v1
  with:
    # Paths to update (optional, default: readme.txt)
    file-paths: |
      readme.txt
      src/other-file.php
    # Create a pull request, or commit directly if disabled (optional, default: true)
    create-pr: true
    # Git author (optional, default: github-actions <github-actions@noreply.github.com>)
    git-author: 'Joe Bloggs <joe.bloggs@example.com>'

Remember to test your project with the latest version of WordPress before publishing a new version!

License

The scripts and documentation in this project are released under the MIT License