octokit-pinned-issues

1.0.0 • Public • Published

octokit-pinned-issues

Octokit plugin to manage pinned issues for a repository

@latest Build Status Coverage Status Greenkeeper

There is no REST API for the new ["Pinned Issues"] feature. This Octokit plugin uses GraphQL under the hood to provide simple methods to manage a repository’s pinned issues.

Usage

const Octokit = require('@octokit/rest')
  .plugin(require('octokit-pinned-issues'))
 
const octokit = new Octokit()
 
octokit.getPinnedIssues({
  owner: 'repo-name',
  repo: 'repo-name'
}).then(issues => {})
octokit.pinIssue({
  owner: 'repo-name',
  repo: 'repo-name',
  number: 123
}).then(issue => {})
octokit.unpinIssue({
  owner: 'repo-name',
  repo: 'repo-name',
  number: 123
}).then(issue => {})

An issue object can have the following properties

[
  {
    id: 'MDU6SXNzdWU...',
    number: 71,
    state: 'OPEN',
    title: 'issue title',
    body: 'issue description',
    locked: false,
    active_lock_reason: null,
    milestone: {
      id: 'MDk6TWlsZXN...',
      state: 'OPEN',
      title: 'Funk',
      description: 'Get Funky!'
    },
    labels: [
      {
        id: 'MDU6TGFiZWw...',
        name: 'foo',
        description: null,
        color: 'ededed'
      }
    ],
    assignees: [
      {
        login: 'gr2m',
        id: 'MDQ6VXNlcj...',
        avatar_url: 'https://avatars3.githubusercontent.com/u/39992?v=4'
      }
    ]
  }
]

LICENSE

MIT

Package Sidebar

Install

npm i octokit-pinned-issues

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

37.6 kB

Total Files

17

Last publish

Collaborators

  • gr2m