Action that checks whether the body or diff in a PR contains a certain word.
Перейти к файлу
Jorge Soares 53fdb18858
Update README.md
2021-02-03 18:12:07 +00:00
.github/workflows Rename and update readme 2021-02-03 17:54:32 +00:00
dist Fix octokit usage and diff request 2021-02-03 17:41:40 +00:00
src Fix octokit usage and diff request 2021-02-03 17:41:40 +00:00
.gitignore Testing release-only branch 2019-09-06 17:43:40 +02:00
LICENSE Initial commit 2019-09-06 11:27:24 +02:00
README.md Update README.md 2021-02-03 18:12:07 +00:00
action.yml Rename and update readme 2021-02-03 17:54:32 +00:00
package-lock.json Fix octokit usage and diff request 2021-02-03 17:41:40 +00:00
package.json Fix octokit usage and diff request 2021-02-03 17:41:40 +00:00
tsconfig.json Initial commit 2019-09-06 11:27:24 +02:00

README.md

GitHub PR Content Checker

This action checks for the presence or absence of a word in the body or diff in a PR, as well as the number of lines and files changed. If fails if one or more of the set criteria isn't met.

Using this action

You need to add this in a file in .github/workflows and set appropriate options.

name: "Check PR content"
on: [pull_request]

jobs:
  check_pr:
    runs-on: ubuntu-latest
    steps:
    - name: Check PR
      uses: jsoares/gh-pr-content-checker@master
      with:
        github-token: ${{github.token}}
        bodyContains: 'Add this'
        bodyDoesNotContain: "Delete this"        
        diffContains: 'Add this'
        diffDoesNotContain: "Delete this"        
        maxLinesChanged: 1
        maxFilesChanged: 1

An example is also provided in .github/workflows/ in this repository.

History

This is a customisation of JJ/github-pr-contains-action, using updated dependencies, improving counting behaviour, and adding a diffDoesNotContain flag.

  • v0: Proof of concept, published to marketplace
  • v1: Adds several more checks
  • v2: Adds check for strings to avoid and creates issues for errors.

--forked--

  • v3: Adds diffDoesNotContain field, improves counting behaviour, update deps

License

This is a modification of JJ/github-pr-contains-action and is released under the MIT license.