Skip to content

Latest commit

 

History

History
45 lines (34 loc) · 1.34 KB

README.md

File metadata and controls

45 lines (34 loc) · 1.34 KB

WP Media PR Checklist Action

A GitHub action that performs checks on PR descriptions, according to WP Media PR template from https://github.com/wp-media/.github.

This action runs the following tests:

  • Description contains at least one text line that is not the one of the template.
  • Documentation contains at least one text line that is not one from the template.
  • At least one type of change is set.
  • All items in the checklist are ticked.

Usage

Create a workflow

name: 'PR Checklist'
on: 
  pull_request:
    types: [edited, opened, synchronize, reopened]

jobs:
  pr-checklist:
    runs-on: ubuntu-latest
    steps:
      - uses: wp-media/pr-checklist-action@master
        with:
          repo-token: "${{ secrets.PR_CHECKLIST_TOKEN }}"

Token

The PR_CHECKLIST_TOKEN must provide read access to Pull Requests of the repository this action is used in.

Making the check mandatory to merge

Once the workflow file is commited, you can make the success mandatory before merging through branch protection:

  • Require status checks to pass before merging
    • Require branches to be up to date before merging
      • Search and select pr-checklist

## Build

Modification to the sources must be done in the src folder. Once the changes are done, npm run build && npm run pack to update the lib & dist folder.

📝 Licence

MIT