Protect from bad token
Browse filesFiles changed (2)
- app.py+7-2
- graphql_calls.py+9-1
15 unmodified lines1617181919202122232425262728293031323323 unmodified lines575859556061626315 unmodified lines repo: str, tag: str, branch: str, contributor_treshold: int, contributor_treshhold: int, ignore_dependabot: bool, ignore_direct: bool,): date = get_tag_commit_date(token, repo, tag)
if date is None: return "The token was invalid or didn't have the necessary scopes."
commits = get_commits(token, repo, branch, date)
result = "" contributors = {}
23 unmodified lines result += f"* {commit.message} by @{commit.user.name} (direct commit on {branch})\n"
significant_contributors = { k: v for k, v in contributors.items() if (v.additions + v.deletions) > contributor_treshold and k != '<NOT FOUND>' k: v for k, v in contributors.items() if (v.additions + v.deletions) > contributor_treshhold and k != '<NOT FOUND>' }
if len(significant_contributors):42 unmodified lines4344454647484946505152535455565742 unmodified lines }} }} """
response = call_with_query(query, token)
try: return call_with_query(query, token)['data']['repository']['object']['committedDate'] committed_date = response['data']['repository']['object']['committedDate'] except KeyError: committed_date = None
return committed_date
def get_commits(token, repository, branch, since):app.py+7-2
graphql_calls.py+9-1