retrolabeler

command module
v0.0.0-...-4358137 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

README

retrolabeler

The tool to label existing PRs in a GitHub repository according to the rules in actions/labeler format.

actions/labeler is a GitHub Action that defines the YAML configuration format of the rules how to label pull requests according to which files were changed. It works great for new PRs, but there is no way currently to label already existing ones. retrolabeler solves that problem. The tool bases on v4 GraphQL API and has these features:

  • Automatic retries on 5xx responses (GitHub backend crashes).
  • Automatic sleep upon draining the rate limit.
  • Create the labels mentioned in YAML but not present in the repository on the fly (-c).
  • Specify the date since which to label PRs (-s).
  • Dry run mode: execute everything but the actual mutations - label creation and PR labeling (-dry-run).
  • Fast PR labeling in multiple parallel workers (-j, 2 by default).

Installation

You need to have a Go compiler 1.17+.

GOBIN=$(pwd) go install github.com/athenianco/retrolabeler@latest

Usage

Obtain the GitHub token either from your Personal Access Tokens or by running the provided Python script intended for GitHub application developers cat app_private_key.pem | python3 token_from_pem.py <installation id>.

export GITHUB_TOKEN=...
cat .github/labeler.yml | retrolabeler -c owner/reponame

Note: the tool does not support all the advanced features of minimatch. The underlying glob engine is gobwas/glob.

License

Apache 2.0, see LICENSE.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL