Skip to content

Commit 884f33a

Browse files
committed
fix: add actionlint rules in sarif and in --list-rules
1 parent edf209c commit 884f33a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

core/linter.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ func filterUnWantedRules(rules []actionlint.Rule) []actionlint.Rule {
7878
// }
7979
}
8080

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

0 commit comments

Comments
 (0)