bighut-relabel
TypeScript icon, indicating that this package has built-in type declarations

1.5.1 • Public • Published

bighut-relabel

NPM Version License Build Status Coverage Status Last Commit Node Version

Node.js library for automatically analyzing and managing pull requests on GitHub.

Features

  • Fluent API.
  • Getting information about a pull request, including state, title, description, author info, labels, milestone, merge direction, conflicts, files, commits, comments, and reviewers.
  • Updating title, description, labels, and milestone.
  • Adding new comments to pull requests.
  • Creation and removing code review requests.
  • Deleting branches.
  • Simple conditions for pull requests analysis.
  • Flex customization.

Install

npm install bighut-relabel

Usage

import { createConfig, fix, test } from 'bighut-relabel';

// create config
const config = createConfig();

// automatic addition of labels depending on file extensions
// please note, labels should already be present in the repository

config
  .addLabel('back end')
  .whenFilePath(/\.cs$/);

config
  .addLabel('front end')
  .whenFilePath(/\.(((t|j)sx?)|(s?css))$/);

// repository options
const repository = {
  config: config,
  auth: {
    owner: '%GITHUB USERNAME OR ORG NAME HERE%',
    repo:  '%GITHUB REPOSITORY NAME HERE%',
    // https://github.com/sfm-tools/bighut-relabel
    //                   ^^^^^^^^  ^^^^^^^^^^^^^^
    //                   owner     repo
    token: '%YOUR GITHUB TOKEN HERE%',
  },
  // optional settings
  /*
  options: {
    threads: 10,
    limit: 50,
    rateLimitNotify: 2500,
    cache: {
      ttl: 600, // caching for 600 seconds
    },
    log: 'actions', // levels: info (default), action, warining, error, debug, custom
  }
  */
};

// preview - without making any changes to pull requests
test(repository);

// or apply changes to pull requests
// fix(repository);

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.5.1
    2
    • latest

Version History

Package Sidebar

Install

npm i bighut-relabel

Weekly Downloads

10

Version

1.5.1

License

MIT

Unpacked Size

284 kB

Total Files

352

Last publish

Collaborators

  • aleksey.nemiro