https://github.com/gr2m/octokit-pinned-issues
Octokit plugin to manage pinned issues for a repository
https://github.com/gr2m/octokit-pinned-issues
issues octokit pinned plugin
Last synced: 12 months ago
JSON representation
Octokit plugin to manage pinned issues for a repository
- Host: GitHub
- URL: https://github.com/gr2m/octokit-pinned-issues
- Owner: gr2m
- License: mit
- Created: 2018-12-16T21:53:37.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-10-17T22:11:07.000Z (over 2 years ago)
- Last Synced: 2025-04-24T07:16:44.094Z (about 1 year ago)
- Topics: issues, octokit, pinned, plugin
- Language: JavaScript
- Size: 580 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# octokit-pinned-issues
> Octokit plugin to manage pinned issues for a repository
[](https://github.com/gr2m/octokit-pinned-issues/actions/workflows/test.yml)
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
```js
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
```js
[
{
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](LICENSE)