Code Monkey home page Code Monkey logo

wordpress-version-checker's Introduction

WordPress version checker

GitHub CI Codecov

A GitHub action to automatically create issues when a plugin "tested up to" version doesn't match the latest WordPress version.

Usage

This action fires on every push to master and once every day if you use this recommended config:

name: "WordPress version checker"
on:
  push:
    branches:
      - master
  schedule:
    - cron: '0 0 * * *'

permissions:
  issues: write

jobs:
  wordpress-version-checker:
    runs-on: ubuntu-latest
    steps:
      - name: WordPress version checker
        uses: skaut/[email protected]
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}

Configuration

The app doesn't stricly require any configuration, however you can configure some aspects of its function by placing a file named .wordpress-version-checker.json in the root of your repository. The file may contain any of the following configuration options:

Plugin readme location

By default, the app checks for readme in readme.txt and plugin/readme.txt. If the readme of your plugin is not in one of these locations, you can configure the app to look somewhere else with the readme value in the configuration. The value can be either a single location or an array of locations to check - if multiple locations are provided, they will be checked in the given order until the first match.

Examples

{
    "readme": "path/to/your/readme.txt"
}
{
    "readme": ["path/to/first/readme.txt", "path/to/second/readme.txt"]
}

WordPress release channel

By default, the app will notify you once an upcoming WordPress version reaches the release candidate stage of development. By setting the channel value to one of stable, rc or beta, you can choose to be notified when the new version is fully released, is in the release candidate (RC) stage of development, or when the first beta versions are released respectively.

Example

{
    "channel": "beta"
}

Issue assignees

By default, the issue will have no assignees. If you want the issues to be automatically assigned to someone, you can put their GitHub usernames in the config as the assignees value.

Example

{
    "assignees": ["alice", "bob"]
}

wordpress-version-checker's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar github-actions[bot] avatar jdevalk avatar marekdedic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

wordpress-version-checker's Issues

Fix Octokit deprecation

{ Deprecation: [@octokit/rest] "result.data.repositories" is deprecated. Use "result.data" instead

    at Array.get (/rbd/pnpm-volume/a766a15d-3d6a-476b-a6ec-21fc8beaa1f0/node_modules/.registry.npmjs.org/@octokit/rest/16.30.1/node_modules/@octokit/rest/plugins/pagination/normalize-paginated-list-response.js:66:9)

    at github.paginate.response (/rbd/pnpm-volume/a766a15d-3d6a-476b-a6ec-21fc8beaa1f0/node_modules/.registry.npmjs.org/probot-scheduler/2.0.0-beta.1/node_modules/probot-scheduler/index.js:99:30)

    at iterator.next.then.result (/rbd/pnpm-volume/a766a15d-3d6a-476b-a6ec-21fc8beaa1f0/node_modules/.registry.npmjs.org/@octokit/rest/16.30.1/node_modules/@octokit/rest/plugins/pagination/paginate.js:31:15) name: 'Deprecation' }

Unable to detect `readme.txt` file

For some reason some of our repos are failing on this action with the following error message:

Couldn't get the repository readme. Error message: No "Tested up to:" line found

See:

Meanwhile, other similar repos with the same setup are passing, see:

Any idea if there's something amiss with these four repos above or perhaps just a hiccup in the GitHub Action runs?

v1.4.0 unable to find readme files

I've got two plugins I've started to update:

  1. 10up/Ad-Refresh-Control#118
  2. 10up/ads-txt#145

However, when checking the runs on each I'm getting the same error:
Error: Couldn't get the repository readme. Error message: No "Tested up to:" line found:

  1. https://github.com/10up/Ad-Refresh-Control/actions/runs/5394647326/jobs/9796106790?pr=118
  2. https://github.com/10up/ads-txt/actions/runs/5394689367/jobs/9796202669?pr=145

The first one I thought perhaps it might be an issue with the capital letters in the repo name, but the second repo had the same problem. Curious if there's anything that looks amiss in the workflow file update or the new config JSON that might be causing this?

Optional flag to check at Release Candidate phase

When a major WordPress release hits the initial Release Candidate phase (aka RC1), that's generally a good time to start testing for compatibility and then bumping the "tested up to" value. It would be nice to have an optional flag or something with the action here to not check against the latest WordPress version but perhaps the latest WordPress version OR one that's in development and at least at the RC1 phase.

App crashes if it can't find readme

11:59:41.505Z  INFO event: Couldn't get the readme of repository skaut/skaut-google-drive-gallery at path src/readme.txt. Error message: HttpError: Not Found

/rbd/pnpm-volume/a766a15d-3d6a-476b-a6ec-21fc8beaa1f0/node_modules/.registry.npmjs.org/probot/9.5.0/node_modules/probot/lib/index.js:186

        var errMessage = (err.message || '').toLowerCase();

                              ^

TypeError: Cannot read property 'message' of undefined

    at process.Probot.errorHandler (/rbd/pnpm-volume/a766a15d-3d6a-476b-a6ec-21fc8beaa1f0/node_modules/.registry.npmjs.org/probot/9.5.0/node_modules/probot/lib/index.js:186:31)

    at process.emit (events.js:189:13)

    at process.EventEmitter.emit (domain.js:441:20)

    at emitPromiseRejectionWarnings (internal/process/promises.js:119:20)

    at process._tickCallback (internal/process/next_tick.js:69:34)

Support more readme locations

Currently, the readme is only read from plugin/readme.txt. We should support more locations - ideally you could set this up per-repo (that would require storing repo information). A simpler approach is to just support a common set of paths.

WordPress version API responses

Issue tracking the response values of

  • https://api.wordpress.org/core/version-check/1.7/?channel=development
  • https://api.wordpress.org/core/version-check/1.7/?channel=beta
  • https://api.wordpress.org/core/version-check/1.7/?channel=rc
  • https://api.wordpress.org/core/version-check/1.7/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.