usethis (version 1.5.1)

use_github_labels: Manage GitHub issue labels

Description

use_github_labels() can create new labels, update colours and descriptions, and optionally delete GitHub's default labels (if delete_default = TRUE). It will never delete labels that have associated issues.

use_tidy_labels() calls use_github_labels() with tidyverse conventions powered by tidy_labels(), tidy_labels_rename(), tidy_label_colours() and tidy_label_descriptions().

Usage

use_github_labels(repo_spec = github_repo_spec(), labels = character(),
  rename = character(), colours = character(),
  descriptions = character(), delete_default = FALSE,
  auth_token = github_token(), host = NULL)

use_tidy_labels(repo_spec = github_repo_spec(), auth_token = github_token(), host = NULL)

tidy_labels()

tidy_labels_rename()

tidy_label_colours()

tidy_label_descriptions()

Arguments

repo_spec

Optional repository specification (owner/repo) if you don't want to target the current project.

labels

A character vector giving labels to add.

rename

A named vector with names giving old names and values giving new names.

colours, descriptions

Named character vectors giving hexadecimal colours (like e02a2a) and longer descriptions. The names should match label names, and anything unmatched will be left unchanged. If you create a new label, and don't supply colours, it will be given a random colour.

delete_default

If TRUE, removes GitHub default labels that do not appear in the labels vector and that do not have associated issues.

auth_token

GitHub personal access token (PAT).

host

GitHub API host to use. Override with the endpoint-root for your GitHub enterprise instance, for example, "https://github.hostname.com/api/v3".

Label usage

Labels are used as part of the issue-triage process, designed to minimise the time spent re-reading issues. The absence of a label indicates that an issue is new, and has yet to be triaged.

  • reprex indicates that an issue does not have a minimal reproducible example, and that a reply has been sent requesting one from the user.

  • bug indicates an unexpected problem or unintended behavior.

  • feature indicates a feature request or enhancement.

  • docs indicates an issue with the documentation.

  • wip indicates that someone is working on it or has promised to.

  • good first issue indicates a good issue for first-time contributors.

  • help wanted indicates that a maintainer wants help on an issue.

Examples

Run this code
# NOT RUN {
# typical use in, e.g., a new tidyverse project
use_github_labels(delete_default = TRUE)

# create labels without changing colours/descriptions
use_github_labels(
  labels = c("foofy", "foofier", "foofiest"),
  colours = NULL,
  descriptions = NULL
)

# change descriptions without changing names/colours
use_github_labels(
  labels = NULL,
  colours = NULL,
  descriptions = c("foofiest" = "the foofiest issue you ever saw")
)
# }

Run the code above in your browser using DataCamp Workspace