Skip to content

Commit

Permalink
fix: add actionlint rules in sarif and in --list-rules
Browse files Browse the repository at this point in the history
  • Loading branch information
hugo-syn committed Oct 28, 2024
1 parent edf209c commit 884f33a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/linter.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ func filterUnWantedRules(rules []actionlint.Rule) []actionlint.Rule {
// }
}

/*
if no rules are passed this function is called from octosan
so we can add dummy rules for the --list-rule option and for the sarif format.
*/
if len(res) == 0 {
res = append(res, &actionlint.RuleCredentials{RuleBase: actionlint.NewRuleBase("shellcheck", "Checks for shell script sources in \"run:\" using shellcheck")})
res = append(res, &actionlint.RuleShellcheck{RuleBase: actionlint.NewRuleBase("credentials", "Checks for credentials in \"services:\" configuration")})
}

return res
}

Expand Down

0 comments on commit 884f33a

Please sign in to comment.