# @github-hooks/comments

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

Latest version **0.0.1-4** (published 2018-06-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install @github-hooks/comments
pnpm add @github-hooks/comments
yarn add @github-hooks/comments
bun add @github-hooks/comments
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1-4 |
| Published | 2018-06-11 |
| First published | 2018-06-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 8.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | boyney123 |

## Links

- npm: https://www.npmjs.com/package/@github-hooks/comments
- npm.io page: https://npm.io/package/@github-hooks/comments

## Dependencies (2)

- [request](https://npm.io/package/request.md) ^2.87.0
- [request-promise](https://npm.io/package/request-promise.md) ^4.2.2

## Recent versions

- 0.0.1-4 (latest) — 2018-06-11
- 0.0.1-3 — 2018-06-11

## README

# github-hooks-comment

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

## Getting Started

Plugin example:

```js
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.

```js
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 });
```

---
_Source: https://npm.io/package/@github-hooks/comments · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
