Skip to content

Commit

Permalink
bugfix: fix gh api not accepting color hash with the # symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
seyLu committed Aug 27, 2023
1 parent 9120593 commit 3e90ed6
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions scripts/setup_issue_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,25 @@ def _load_labels(self) -> list[dict[str, str]]:

def create_labels(self) -> None:
for label in self._labels:
label["color"] = label["color"].replace("#", "")

res: Response = requests.post(
url=self._url,
self._url,
headers=self._headers,
json=label,
)

if res.status_code == 201:
logging.info(f"Label {label['name']} created successfully.")
logging.info(f"Label `{label['name']}` created successfully.")
else:
logging.error(f"Failed to create label {label['name']}.")
logging.error(
f"Status {res.status_code}. Failed to create label `{label['name']}`."
)


def main() -> None:
GithubIssueLabel()
# github_issue_label.create_labels()
github_issue_label = GithubIssueLabel()
github_issue_label.create_labels()
logging.info("Label creation process completed.")


Expand Down

0 comments on commit 3e90ed6

Please sign in to comment.