Sets labels for a GitHub repository, including renaming existing similar labels.
🏷️
Usage
Sets a collection of labels on a repository.
For each outcome label, if its name, the same words excluding its prefix:, or any of its aliases already exists, that existing label is updated.
Otherwise, a new label is created.
Node.js API
npm i set-github-repository-labels
set-github-repository-labels provides two functions:
determineLabelChanges: describes the changes a repository's labels would need to get to the outcome labels
existingLabels: an array of the labels that currently exist on a repository
outcomeLabels: an array of the labels that you want to exist on the repository
Returns an array of change objects describing the network requests that would be needed to change the repository's existing labels to the outcome labels.
For example, determine label changes on an existing repository with only one label to having two: