diff --git a/core/linter.go b/core/linter.go index 1c478c1..481633d 100644 --- a/core/linter.go +++ b/core/linter.go @@ -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 }