@github-hooks/comments
A `github-hooks` plugin that automaticly put a comment against a newly created issue or pull request.
Last updated 2 years ago by boyney123 .
ISC · Original npm · Tarball · package.json
$ cnpm install @github-hooks/comments 
SYNC missed versions from official npm registry.

github-hooks-comment

A github-hooks plugin that automaticly put a comment against a newly created issue or pull request.

Getting Started

Plugin example:

comments({
    // message to post
    message: 'Thanks for creating a new issue',
    // github token
    token: process.env.GITHUB_TOKEN
});

Parameters

  1. message (String): The message to post back to Github once your event has been triggered.
  2. token (String): Your github token (required to post)

Example

In the example below we have setup the github-hooks-comments plugin with new issues and pull requests.

const hooks = require('@github-hooks');
const comments = require('@github-hooks-comments');

// Setup config. In this example we are using the comments plugin on issues that are created and opened. Also we have configured opened pull requests
hooks.setConfig({
    issues: {
        created: {
            plugins: [
                comments({
                    message: 'Thanks for creating a new issue',
                    token: process.env.GITHUB_TOKEN
                })
            ]
        },
        opened: {
            plugins: [
                comments({
                    message: 'Thanks for opening a new issue',
                    token: process.env.GITHUB_TOKEN
                })
            ]
        }
    },
    pull_request: {
        opened: {
            plugins: [
                comments({
                    message: 'This is an automaticed response. Thank you for submitting a pull request',
                    token: process.env.GITHUB_TOKEN
                })
            ]
        }
    }
});

hooks.run({ port: 3000 });

Current Tags

  • 0.0.1-4                                ...           latest (2 years ago)

2 Versions

  • 0.0.1-4                                ...           2 years ago
  • 0.0.1-3                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 5
Last Day 1
Last Week 2
Last Month 0
Dependencies (2)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |