INNER CODE UNIT · Python

apply_label

openfaas/workshop · issue-bot/bot-handler/handler.py:39

def apply_label(polarity, issue_number, repo, positive_threshold):
    token = os.getenv("auth_token")

    if len(token) == 0:
        with open("/var/openfaas/secrets/alexellis_github_auth_token") as f:
            token = f.read().strip()
            f.close()

    g = Github(token)
    repo = g.get_repo(repo)
    issue = repo.get_issue(issue_number)

    has_label_positive = False
    has_label_review = False
    for label in issue.labels:
        if label == "positive":
            has_label_positive = True
        if label == "review":

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…