Skip to content

Commit

Permalink
Stop sending an api request when no labels need to be applied
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackenmen committed Mar 27, 2023
1 parent 21682dc commit bb918d5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/label_doconly_changes/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,11 @@ def run(self) -> int:
)
if self.is_doc_only:
labels_to_apply = labels - self.pr_info.labels
resp = session.post(base_url, json={"labels": list(labels_to_apply)})
resp.raise_for_status()
if labels_to_apply:
resp = session.post(
base_url, json={"labels": list(labels_to_apply)}
)
resp.raise_for_status()
else:
labels_to_remove = labels & self.pr_info.labels
for label in labels_to_remove:
Expand Down

0 comments on commit bb918d5

Please sign in to comment.