def update_label()

in migration/src/github_issues_util.py [0:0]


def update_label(token: str, repo: str, name: str, color: str, description: str, logger: Logger) -> bool:
    url = GITHUB_API_BASE + f"/repos/{repo}/labels/{name}"
    headers = {"Authorization": f"token {token}", "Accept": "application/vnd.github.v3+json"}
    data = {"color": color, "description": description}
    res = requests.patch(url, headers=headers, json=data)
    time.sleep(INTERVAL_IN_SECONDS)
    if res.status_code != 200:
        logger.error(f"Failed to update label {name}; status_code={res.status_code}, message={res.text}")
        return False
    logger.debug(f"Label {name} updated.")
    return True