Skip to content

Codeinwp/action-product-compat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

action-product-compat

A GitHub Action that verifies a pull request has been reviewed for product compatibility before merging.

When a PR is opened or updated, the action checks for a compatibility-reviewed label. If the label is missing, the check fails and a comment is posted on the PR reminding the developer to review the themeisle_sdk_compatibilities filter. Once the label is added and the check re-runs, the comment is automatically removed.

Usage

Sample workflow

Create .github/workflows/compatibility-check.yml in your repository:

name: Compatibility Check

on:
  pull_request:
    types: [opened, reopened, synchronize, labeled, unlabeled]
    branches:
      - main

jobs:
  compatibility-check:
    name: Verify Compatibility Review
    runs-on: ubuntu-latest
    steps:
      - name: Check compatibility label
        uses: Codeinwp/action-product-compat@v1
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}

Inputs

Input Required Default Description
github-token Yes GitHub token used to read labels and post comments. Use ${{ secrets.GITHUB_TOKEN }}.
label No compatibility-reviewed The label that marks a PR as reviewed.
message No (see below) Custom comment message posted when the label is missing.

Default message:

Make sure you've reviewed the themeisle_sdk_compatibilities filter of the plugin and updated it accordingly.

Outputs

Output Description
has_label "true" or "false" — whether the compatibility label is present on the PR.

Custom message example

- name: Check compatibility label
  uses: Codeinwp/action-product-compat@v1
  with:
    github-token: ${{ secrets.GITHUB_TOKEN }}
    message: 'Please review the compatibility matrix before merging.'

How it works

  1. PR opened / updated — the action checks if the compatibility-reviewed label is on the PR.
  2. Label missing — the action fails and posts a comment. If a comment already exists from a previous run, it is updated rather than duplicated.
  3. Label added — the action passes and the bot comment is automatically removed from the PR.

Development

Install dependencies:

npm install

Build the distributable (required before committing or releasing):

npm run build

Commit the generated dist/ folder along with your changes.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors