コード例 #1
0
def add_topic(repo: Repository):
    """Add hacktoberfest topic to the repo."""
    topics_list = repo.get_topics()
    if "hacktoberfest" not in topics_list:
        topics_list.append("hacktoberfest")
        repo.replace_topics(topics_list)
コード例 #2
0
def remove_topic(repo: Repository):
    """Remove hacktoberfest topic from repo."""
    topics_list = repo.get_topics()
    if "hacktoberfest" in topics_list:
        topics_list = [t for t in topics_list if t != "hacktoberfest"]
        repo.replace_topics(topics_list)