issue-labels

Issue labels

Fetch and parse GitHub issue labels.

Review Version Downloads Size Quality Coverage

Installing

npm install issue-labels

Motivation

GitHub issue labels can get out of hand. We can define rules and check they are follow them:

import { Check, Issue, audit, environment, issues } from "issue-labels";

const { remote, token } = environment();

const checks: Check<Issue>[] = [
{
conditions: ({ isPR, version }) => [isPR, !version],
message: "Pull request is missing a version label",
},
];

issues({ remote, token }, "P1D").then((issues) => {
console.log(audit(checks, issues));
});
[
{
"problems": ["Pull request is missing a version label"],
"input": {
"id": 1,
"url": "https://github.com/owner/repository/pull/1",
"title": "Pull request title",
"date": "2025-01-01T00:00:00.000+00:00",
"isPR": true,
"assignee": null,
"directions": [],
"version": null,
"labels": [],
"flags": {
"triage": false,
"question": false,
"unanswered": false,
"helpWanted": false
}
}
}
]

environment

Documentation

Documentation and more detailed examples are hosted on Github Pages.

Tooling

Dependencies

To install dependencies:

yarn install

Tests

To run tests:

yarn test

Documentation

To generate the documentation locally:

yarn docs

Linters

To run linters:

yarn lint

Formatters

To run formatters:

yarn format

Contributing

Please read this repository's Code of Conduct which outlines our collaboration standards and the Changelog for details on breaking changes that have been made.

This repository adheres to semantic versioning standards. For more information on semantic versioning visit SemVer.

Bump2version is used to version and tag changes. For example:

bump2version patch

Contributors

Remarks

Lots of love to the open source community!

Be kind to your mind Love each other It's ok to have a bad day