File tree Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Original file line number Diff line number Diff line change 1+ tests :
2+ - name : " Should have pre-commit enabled"
3+ def : {}
4+ params : {}
5+ expect : " pass"
6+ git :
7+ repo_base : good
8+ - name : " Should not have pre-commit enabled"
9+ def : {}
10+ params : {}
11+ expect : " fail"
12+ git :
13+ repo_base : bad
Original file line number Diff line number Diff line change 1+ ---
2+ version : v1
3+ release_phase : alpha
4+ type : rule-type
5+ name : pre_commit_github_action
6+ display_name : Require running `pre-commit` using GitHub Actions
7+ short_failure_message : ` https://github.com/pre-commit/action` action is not configured
8+ severity :
9+ value : medium
10+ context : {}
11+ description : |
12+ Verifies that `pre-commit` is configured via a GitHub action for the repository.
13+ guidance : |
14+ Run your `pre-commit` checks in GitHub Actions as well.
15+ def :
16+ in_entity : repository
17+ rule_schema :
18+ type : object
19+ properties : {}
20+ ingest :
21+ type : git
22+ git : {}
23+ eval :
24+ type : rego
25+ rego :
26+ type : deny-by-default
27+ def : |
28+ package minder
29+
30+ import rego.v1
31+ actions := github_workflow.ls_actions("./.github/workflows")
32+ default message := "pre-commit GitHub action is not configured"
33+ default allow := false
34+ allow if {
35+ "pre-commit/action" in actions
36+ }
37+ # Defines the configuration for alerting on the rule
38+ alert :
39+ type : security_advisory
40+ security_advisory : {}
You can’t perform that action at this time.
0 commit comments