Skip to content

Commit f51f211

Browse files
authored
Merge pull request #12 from pmarsceill/fix/gh-project-sync-update-status
fix(cli): use project node ID for GitHub status updates
2 parents f4305c5 + a9d02ea commit f51f211

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

internal/cli/task_sync.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414

1515
// GitHub Project data structures for JSON parsing
1616
type ghProject struct {
17+
ID string `json:"id"`
1718
Number int `json:"number"`
1819
Title string `json:"title"`
1920
}
@@ -200,7 +201,7 @@ func runTaskSyncGHProject(cmd *cobra.Command, args []string) error {
200201
fmt.Printf(" Created task: %s\n", task.TaskId)
201202

202203
// Update item status on GitHub
203-
if err := updateItemStatus(project.Number, item.ID, statusField.ID, targetOptionID); err != nil {
204+
if err := updateItemStatus(project.ID, item.ID, statusField.ID, targetOptionID); err != nil {
204205
fmt.Printf(" Warning: failed to update GitHub status: %v\n", err)
205206
} else {
206207
fmt.Printf(" Moved to %q on GitHub\n", syncTargetColumn)
@@ -307,10 +308,10 @@ func buildTaskDescription(item ghItem) string {
307308
return sb.String()
308309
}
309310

310-
func updateItemStatus(projectNumber int, itemID, fieldID, optionID string) error {
311+
func updateItemStatus(projectID, itemID, fieldID, optionID string) error {
311312
args := []string{
312313
"project", "item-edit",
313-
"--project-id", fmt.Sprintf("%d", projectNumber),
314+
"--project-id", projectID,
314315
"--id", itemID,
315316
"--field-id", fieldID,
316317
"--single-select-option-id", optionID,

0 commit comments

Comments
 (0)