GRM-35: fix: release push permission and notify_failure label IDs
Fix two issues found during release workflow testing. Closes GRM-35
This commit is contained in:
@@ -51,15 +51,17 @@ def main(repo: str, run_id: str, workflow: str, commit: str) -> None:
|
||||
)
|
||||
|
||||
try:
|
||||
issue = client.create_issue(title=title, body=body, labels=["bug"])
|
||||
# Look up label IDs by name (Gitea API expects integer IDs, not strings)
|
||||
label_ids: list[int] = []
|
||||
for label in client.list_labels():
|
||||
if label.get("name") == "bug":
|
||||
label_ids.append(int(label["id"]))
|
||||
break
|
||||
issue = client.create_issue(title=title, body=body, labels=label_ids if label_ids else None)
|
||||
except APIError as e:
|
||||
# If labels don't exist, retry without labels
|
||||
if e.status == 404:
|
||||
issue = client.create_issue(title=title, body=body)
|
||||
else:
|
||||
raise click.ClickException(
|
||||
_("Failed to create issue: HTTP {status} — {message}", status=e.status, message=e.message)
|
||||
) from None
|
||||
raise click.ClickException(
|
||||
_("Failed to create issue: HTTP {status} — {message}", status=e.status, message=e.message)
|
||||
) from None
|
||||
|
||||
click.echo(
|
||||
_(
|
||||
|
||||
Reference in New Issue
Block a user