Git Product home page Git Product logo

pull-request-comment-trigger's Introduction

Pull Request Comment Trigger

Look for a "trigger word" in a pull-request description or comment, so that later steps can know whether or not to run.

Example usage in a workflow

Your workflow needs to listen to the following events:

on:
  pull_request:
    types: [opened]
  issue_comment:
    types: [created]

And then you can use the action in your jobs like this:

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: khan/pull-request-comment-trigger@master
        id: check
        with:
          trigger: '@deploy'
          reaction: rocket
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
      - run: 'echo Found it!'
        if: steps.check.outputs.triggered == 'true'

Reaction must be one of the reactions here: https://developer.github.com/v3/reactions/#reaction-types And if you specify a reaction, you have to provide the GITHUB_TOKEN env vbl.

Inputs

Input Required? Description
trigger Yes The string to look for in pull-request descriptions and comments. For example "#build/android".
prefix_only No (default 'false') If 'true', the trigger must match the start of the comment.
reaction No (default '') If set, the specified emoji "reaction" is put on the comment to indicate that the trigger was detected. For example, "rocket".

Outputs

Output Description
triggered 'true' or 'false' depending on if the trigger phrase was found.
comment_body The comment body.

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.