1.0.0 • Published 7 years ago

github-issue-logger v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

github-issue-logger NPM version Build Status Dependency Status Coverage percentage

A module for logging errors as issues on the github repos issues tab.

Installation

$ npm install --save github-issue-logger

Usage

const githubIssueLogger = require('github-issue-logger');

  githubIssueLogger.setToken('github personal token');

  const repoName = 'app-seo-checks';
  const repoOwner = 'robertjgabriel';
  const issueTitle = 'Issue title';
  const issueBody = 'More details';

  githubIssueLogger.createIssue(repoName, repoOwner, issueTitle, issueBody).then(data =>{
    console.log(data);// See repsonses
  }); 
  // This will return and object.

Responses

On Error

    { 
      extra: '',
      status: 'error',
      url: 'https://api.github.com/repos/robertjgabriel/app-seo-checka/issues'
    }

On incorrect setup

    { 
      extra: '',
      status: 'Not Found',
      url: 'https://api.github.com/repos/robertjgabriel/app-seo-checka/issues'
    }

On Success

    { 
      extra: '',
      status: 'Created',
      url: 'https://api.github.com/repos/robertjgabriel/app-seo-checka/issues'
    }

Getting github personal token.

How to

Clear more here

Set environment variable

process.env.githubPersonalToken = 'Token'

License

MIT © Robert James Gabriel

1.0.0

7 years ago