fix getting issue index
Some checks failed
Gosec Check / Gosec Check (push) Failing after 36s

This commit is contained in:
Shane C 2024-09-06 16:37:49 -04:00
parent 0059e7de34
commit 1fedfc0ffb
Signed by: shanec
GPG key ID: E46B5FEA35B22FF9

View file

@ -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)