diff --git a/manage_labels.py b/manage_labels.py index 056b08b..0a2f52f 100755 --- a/manage_labels.py +++ b/manage_labels.py @@ -4,9 +4,14 @@ Auth follows the project convention: credentials are pulled from the macOS keychain via `git credential fill` (HTTPS), then sent as Basic auth. -Usage: - ./manage_labels.py # create labels, then apply the mapping below - ./manage_labels.py --dry # print actions without writing +Modes (default = create labels then apply the one-off MAPPING, preserving the +original behavior): + + ./manage_labels.py # create labels + apply MAPPING + ./manage_labels.py --create-labels # idempotent label creation only + ./manage_labels.py --apply-mapping # one-off MAPPING labeling only + ./manage_labels.py --add-label 42 chore # add one label to one issue + ./manage_labels.py --dry ... # print actions without writing """ import os import sys @@ -34,7 +39,7 @@ LABELS = [ "description": "Issue is being worked on"}, ] -# issue number -> label names to apply +# issue number -> label names to apply (one-off backfill) MAPPING = { 23: ["chore"], 22: ["chore"], @@ -56,6 +61,11 @@ MAPPING = { BASE_URL = repo_api_url(HOST, ORG, REPO) +USAGE = ( + "usage: manage_labels.py [--dry] " + "[--create-labels | --apply-mapping | --add-label