bug: forgejo-cli — --labels flag passes string values instead of integers #48

Closed
opened 2026-05-29 21:52:58 -04:00 by jasper · 0 comments
Contributor

Summary

The forgejo-cli issue create command passes label IDs as strings when the Forgejo API expects integers.

Root Cause

In the argument parser (line 480 of the CLI script):

labels = [x.strip() for x in rest[i + 1].split(",")]

This produces ["8"] but the Forgejo API expects [8].

Steps to Reproduce

forgejo-cli issue create --owner magnus --repo agent-skills --title "Test" --labels 8

Returns: API error (422): cannot unmarshal string into Go struct field CreateIssueOption.labels of type int64

Fix

Convert label values to integers:

labels = [int(x.strip()) for x in rest[i + 1].split(",") if x.strip().isdigit()]

Found during SkillOpt omnibus PR workflow.

## Summary The forgejo-cli issue create command passes label IDs as strings when the Forgejo API expects integers. ## Root Cause In the argument parser (line 480 of the CLI script): ```python labels = [x.strip() for x in rest[i + 1].split(",")] ``` This produces `["8"]` but the Forgejo API expects `[8]`. ## Steps to Reproduce ``` forgejo-cli issue create --owner magnus --repo agent-skills --title "Test" --labels 8 ``` Returns: `API error (422): cannot unmarshal string into Go struct field CreateIssueOption.labels of type int64` ## Fix Convert label values to integers: ```python labels = [int(x.strip()) for x in rest[i + 1].split(",") if x.strip().isdigit()] ``` Found during SkillOpt omnibus PR workflow.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
magnus/agent-skills#48
No description provided.