GithubHelp home page GithubHelp logo

shayfrendt / github-pr-contains-action Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jj/github-pr-contains-action

0.0 0.0 0.0 16.56 MB

Action that checks whether the body or diff in a PR contains a certain word.

License: MIT License

TypeScript 40.65% JavaScript 59.35%

github-pr-contains-action's Introduction

Checking PRs for words and other things

Based on the actions template, we'll try to create a new action. This new action will check for the presence of a word in the body or diff in a PR. It uses the GitHub API, so you'll need to provide a token. Don't worry, that's built-in.

Using this action

You would need to add this in a file in .github/workflows

name: "Check PR for word"
on: [pull_request]

jobs:
  check_pr:
    runs-on: ubuntu-latest
    steps:
    - name: Check PR
      uses: JJ/github-pr-contains-action@releases/v0
      with:
        github-token: ${{github.token}}
        bodyDoesNotContain: "Delete this"
        bodyContains: 'Test'
        diffContains: 'Test'
        diffDoesNotContain: 'Test'
        filesChanged: 1
        linesChanged: 1

The bodyContain variable will include the string that we want the body of the PR to include, such as checked items in a checklist.

They can be left empty if no check wants to be done.

An example is used as .github/workflows/pr.yaml in this repository.

Contributing to development

Any suggestion, but report, etc, is appreciated. Please use issues for doing that.

History

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

License

This is a modification of the original template, and is released under the MIT license.

github-pr-contains-action's People

Contributors

jj avatar shayfrendt avatar dependabot[bot] avatar

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.