Skip to content

Commit

Permalink
Fix missing format on base URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackenmen committed Jan 5, 2023
1 parent ff0b383 commit 0ef4704
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/label_doconly_changes/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,18 @@ def run(self) -> int:
session = requests.Session()
labels = set(self.options["labels"].split(","))
try:
base_url = BASE_URL.format(
repo_full_name=self.pr_info.repo_full_name,
pr_number=self.pr_info.number,
)
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 = 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:
resp = session.delete(f"{BASE_URL}/{label}")
resp = session.delete(f"{base_url}/{label}")
resp.raise_for_status()
except requests.HTTPError as exc:
self.errored = True
Expand Down

0 comments on commit 0ef4704

Please sign in to comment.