log cwd to see if anything is going wrong
All checks were successful
Gosec Check / Gosec Check (push) Successful in 1m17s

This commit is contained in:
Shane C 2024-09-06 17:33:50 -04:00
parent 231f69012d
commit c7ad8ae323
Signed by: shanec
GPG key ID: E46B5FEA35B22FF9
2 changed files with 7 additions and 10 deletions

3
.actrc Normal file
View file

@ -0,0 +1,3 @@
--github-instance git.shadowhosting.xyz
-W ./.forgejo/workflows
-P node20-bookworm=node:20-bookworm

View file

@ -36,6 +36,8 @@ var rootCmd = &cobra.Command{
log.Fatalln(err)
}
pretty.Logln(cwd)
repo, err := git.PlainOpen(cwd)
if err != nil {
log.Fatalln(err)
@ -146,9 +148,6 @@ var rootCmd = &cobra.Command{
markdownHandler.PlainText(fmt.Sprintf("🟨 **%d** low severity issues\n", sevCountMap["low"]))
}
markdownHandler.PlainTextf("Total of **%d** issues.\n", sevCountMap["high"]+sevCountMap["medium"]+sevCountMap["low"])
}
if len(rows) != 0 {
markdownHandler.CustomTable(markdown.TableSet{
Header: []string{"Rule", "Severity", "Confidence", "Location"},
Rows: rows,
@ -205,13 +204,8 @@ var rootCmd = &cobra.Command{
}
} else {
for _, issue := range issues {
pretty.Logln(issue)
if issue.Title == "GoSec Report" && strings.Contains(issue.Body, "GoSec Report:") {
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{
if issue.Title == "GoSec Report" && strings.Contains(issue.Body, "GoSec Report:") && actionCtx.Repository == issue.Repository.FullName {
if _, _, err := forgeClient.EditIssue(repoOwner, repoName, issue.Index, forgejo.EditIssueOption{
Body: &markdownOutputStr,
}); err != nil {
log.Fatalln(err)