Skip to content

Commit

Permalink
Update pending label
Browse files Browse the repository at this point in the history
  • Loading branch information
cgundy authored Nov 21, 2023
1 parent f8c4ef9 commit faece68
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions reusable_workflows/check_cla/check_cla_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,20 @@ def create_cla_issue(self, user: str) -> GHIssue:
),
)
# replace with PENDING, once new bot has been released
issue.add_labels(GH_WORKFLOW_LABEL)
issue.add_labels(PENDING_LABEL)
return issue

def handle_cla_signed(self, issue: GHIssue, user: str) -> None:
for label in issue.original_labels:
if label.name == APPROVED_LABEL:
return
elif label.name == GH_WORKFLOW_LABEL:
agreement_message = messages.AGREED_MESSAGE.format(user)
issue.create_comment(agreement_message)
issue.remove_label(GH_WORKFLOW_LABEL)
issue.add_labels(APPROVED_LABEL)
return
for pending_label in [GH_WORKFLOW_LABEL, PENDING_LABEL]:
if label.name == pending_label:
agreement_message = messages.AGREED_MESSAGE.format(user)
issue.create_comment(agreement_message)
issue.remove_label(pending_label)
issue.add_labels(APPROVED_LABEL)
return
print(
"No cla labels found - manually check the cla issue to see what state it is in. Exiting program." # noqa
)
Expand Down

0 comments on commit faece68

Please sign in to comment.