Skip to content

Commit

Permalink
Merge branch 'main' into update-cla-issue
Browse files Browse the repository at this point in the history
  • Loading branch information
cgundy authored Dec 2, 2024
2 parents 5ec1fc3 + 97eb381 commit 79cee09
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions reusable_workflows/check_cla/check_cla_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
APPROVED_LABEL = "cla:agreed"
GH_WORKFLOW_LABEL = "cla:gh-wf-pending"

DFINITY_BOT_NAME = "sa-github-api"
DFINITY_BOT_NAME_OLD = "dfinity-droid-prod[bot]"
# keep all old bot names for backwards compatibility
CLA_BOT_NAMES = ["cla-idx-bot[bot]", "sa-github-api", "dfinity-droid-prod[bot]"]


class CLAHandler:
Expand All @@ -25,7 +25,7 @@ def check_comment_already_exists(
self, comments: github3.structs.GitHubIterator
) -> bool:
for comment in comments:
if comment.user.login == DFINITY_BOT_NAME:
if comment.user.login in CLA_BOT_NAMES:
return True
return False

Expand Down Expand Up @@ -56,10 +56,7 @@ def check_if_cla_signed(self, issue: GHIssue, user: str) -> bool:

def get_cla_issue(self, user: str) -> Optional[GHIssue]:
for issue in self.cla_repo.issues():
if issue.title == f"cla: @{user}" and issue.user.login in [
DFINITY_BOT_NAME,
DFINITY_BOT_NAME_OLD,
]:
if issue.title == f"cla: @{user}" and issue.user.login in CLA_BOT_NAMES:
return issue
print(f"No CLA issue for {user}")
return None # to make linter happy
Expand Down

0 comments on commit 79cee09

Please sign in to comment.