From 1fedfc0ffbfa9a518197e481d6845354ca0d96fe Mon Sep 17 00:00:00 2001 From: Shane C Date: Fri, 6 Sep 2024 16:37:49 -0400 Subject: [PATCH] fix getting issue index --- cmd/root.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index b16a4da..be98f07 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -183,7 +183,8 @@ var rootCmd = &cobra.Command{ repoOwner, repoName := actionCtx.Repo() issues, _, err := forgeClient.ListIssues(forgejo.ListIssueOption{ - Type: forgejo.IssueTypeIssue, + Owner: "forgejo-actions", + Type: forgejo.IssueTypeIssue, }) if err != nil { log.Fatalln(err) @@ -207,7 +208,11 @@ var rootCmd = &cobra.Command{ for _, issue := range issues { pretty.Logln(issue) if issue.Title == "GoSec Report" && strings.Contains(issue.Body, "GoSec Report:") { - if _, _, err := forgeClient.EditIssue(repoOwner, repoName, issue.ID, forgejo.EditIssueOption{ + issueID, err := strconv.Atoi(string(issue.HTMLURL[len(issue.HTMLURL)-1])) + if err != nil { + log.Fatalln(err) + } + if _, _, err := forgeClient.EditIssue(repoOwner, repoName, int64(issueID), forgejo.EditIssueOption{ Body: &markdownOutputStr, }); err != nil { log.Fatalln(err)