2.0.11 • Published 3 years ago

get-open-pull-requests v2.0.11

Weekly downloads
6
License
LGPL-3.0
Repository
github
Last release
3 years ago

get-open-pull-requests

Abandoned Use Octokit.

Module to get open PRs from GitHub API. Useful for things like a recurring Slack notification.

Support with PayPal Patreon ko-fi


Installation

npm i get-open-pull-requests

Usage

Get a Token

Go to https://github.com/settings/tokens and get a token that allows user read access. If you're setting this up for an org, allow org read access.

Use It

const prs = require('get-open-pull-requests')
const config = {
  api: '', // github enterprise url, or defaults to api.github.com
  user: '', // user or org slug. example: zacanger
  token: '', // github access token, see below
}

prs(config).then((a) => JSON.stringify(a, null, 2)).then(console.log)

// returns { url, labels, user, title }
// example:
// {
//   url: 'https://github.com/zacanger/styled-reset/pull/9999',
//   title: 'Does a thing',
//   user: 'zacanger',
//   labels: [ 'totally-real-pr', 'discussion' ]
// }

// slack formatting example:

const format = (p) =>
  `*${p.title}* - _${p.user}_ - (<${p.url}>)
  ${p.labels.join(', ')}
  `.trim()

prs(config)
  .then((res) => res.map(format).join('\n\n'))
  .then(sendToSlackOrSomething)

LICENSE

2.0.11

3 years ago

2.0.10

3 years ago

2.0.9

4 years ago

2.0.8

4 years ago

2.0.7

4 years ago

2.0.6

4 years ago

2.0.5

4 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.2.8

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago

0.1.0

5 years ago

0.0.1

5 years ago