Skip to content

Commit

Permalink
Update rule configuration (#179)
Browse files Browse the repository at this point in the history
* Remove branch name requirement in rules

The branch protection rules have a sensible default of the remote HEAD
branch. As a result, they no longer _require_ the branch name. Right
now, callers must specify the branch name as an empty string (since it's
required), but we should instead just remove the requirement entirely.

* Remove filename requirement in rules

The security insights rules have a sensible default of
`SECURITY-INSIGHTS.yml`, thus, we should not require the filename.

* Remove schedule_interval from dependabot rule

The dependabot rule does not use the schedule_interval option; it should
not be required any longer.

* Remove filename requirement in security rules

The security policy rule has a sensible default of `SECURITY.md`,
thus, we should not require the filename.
  • Loading branch information
ethomson authored Oct 11, 2024
1 parent ec60194 commit 668f010
Show file tree
Hide file tree
Showing 18 changed files with 14 additions and 54 deletions.
4 changes: 1 addition & 3 deletions rule-types/github/branch_protection_allow_deletions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ def:
properties:
branch:
type: string
description: "The name of the branch to check. If left empty, the default branch will be used."
required:
- branch
description: "The name of the branch to check. If not specified, the repository's default branch will be used."
# Defines the schema for writing a rule with this rule being checked
rule_schema:
type: object
Expand Down
4 changes: 1 addition & 3 deletions rule-types/github/branch_protection_allow_force_pushes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ def:
properties:
branch:
type: string
description: "The name of the branch to check. If left empty, the default branch will be used."
required:
- branch
description: "The name of the branch to check. If not specified, the repository's default branch will be used."
# Defines the schema for writing a rule with this rule being checked
rule_schema:
type: object
Expand Down
4 changes: 1 addition & 3 deletions rule-types/github/branch_protection_allow_fork_syncing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ def:
properties:
branch:
type: string
description: "The name of the branch to check. If left empty, the default branch will be used."
required:
- branch
description: "The name of the branch to check. If not specified, the repository's default branch will be used."
# Defines the schema for writing a rule with this rule being checked
rule_schema:
properties:
Expand Down
4 changes: 1 addition & 3 deletions rule-types/github/branch_protection_enabled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ def:
properties:
branch:
type: string
description: "The name of the branch to check. If left empty, the default branch will be used."
required:
- branch
description: "The name of the branch to check. If not specified, the repository's default branch will be used."
rule_schema: {}
# Defines the configuration for ingesting data relevant for the rule
ingest:
Expand Down
4 changes: 1 addition & 3 deletions rule-types/github/branch_protection_enforce_admins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ def:
properties:
branch:
type: string
description: "The name of the branch to check. If left empty, the default branch will be used."
required:
- branch
description: "The name of the branch to check. If not specified, the repository's default branch will be used."
# Defines the schema for writing a rule with this rule being checked
rule_schema:
properties:
Expand Down
4 changes: 1 addition & 3 deletions rule-types/github/branch_protection_lock_branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ def:
properties:
branch:
type: string
description: "The name of the branch to check. If left empty, the default branch will be used."
required:
- branch
description: "The name of the branch to check. If not specified, the repository's default branch will be used."
# Defines the schema for writing a rule with this rule being checked
rule_schema:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ def:
properties:
branch:
type: string
description: "The name of the branch to check. If left empty, the default branch will be used."
required:
- branch
description: "The name of the branch to check. If not specified, the repository's default branch will be used."
# Defines the schema for writing a rule with this rule being checked
rule_schema:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ def:
properties:
branch:
type: string
description: "The name of the branch to check. If left empty, the default branch will be used."
required:
- branch
description: "The name of the branch to check. If not specified, the repository's default branch will be used."
# Defines the schema for writing a rule with this rule being checked
rule_schema:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ def:
properties:
branch:
type: string
description: "The name of the branch to check. If left empty, the default branch will be used."
required:
- branch
description: "The name of the branch to check. If not specified, the repository's default branch will be used."
# Defines the schema for writing a rule with this rule being checked
rule_schema:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ def:
properties:
branch:
type: string
description: "The name of the branch to check. If left empty, the default branch will be used."
required:
- branch
description: "The name of the branch to check. If not specified, the repository's default branch will be used."
# Defines the schema for writing a rule with this rule being checked
rule_schema:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ def:
properties:
branch:
type: string
description: "The name of the branch to check. If left empty, the default branch will be used."
required:
- branch
description: "The name of the branch to check. If not specified, the repository's default branch will be used."
# Defines the schema for writing a rule with this rule being checked
rule_schema:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ def:
properties:
branch:
type: string
description: "The name of the branch to check. If left empty, the default branch will be used."
required:
- branch
description: "The name of the branch to check. If not specified, the repository's default branch will be used."
# Defines the schema for writing a rule with this rule being checked
rule_schema:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ def:
properties:
branch:
type: string
description: "The name of the branch to check. If left empty, the default branch will be used."
required:
- branch
description: "The name of the branch to check. If not specified, the repository's default branch will be used."
# Defines the schema for writing a rule with this rule being checked
rule_schema:
properties:
Expand Down
4 changes: 1 addition & 3 deletions rule-types/github/branch_protection_require_signatures.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ def:
properties:
branch:
type: string
description: "The name of the branch to check. If left empty, the default branch will be used."
required:
- branch
description: "The name of the branch to check. If not specified, the repository's default branch will be used."
# Defines the schema for writing a rule with this rule being checked
rule_schema:
type: object
Expand Down
6 changes: 0 additions & 6 deletions rule-types/github/dependabot_configured.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,13 @@ def:
description: |
The package ecosystem that the rule applies to.
For example pip, gomod, npm, docker, github-actions, etc.
schedule_interval:
type: string
description: |
This option is no longer used. It's, however marked as required, so we can't remove
it for backwards compatibility.
apply_if_file:
type: string
description: |
Optional. If specified, the rule will only be evaluated if the given file exists.
This is useful for rules that are only applicable to certain types of repositories.
required:
- package_ecosystem
- schedule_interval
# Defines the configuration for ingesting data relevant for the rule
ingest:
type: git
Expand Down
2 changes: 0 additions & 2 deletions rule-types/github/security_insights.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ def:
description: |
The path to the Security Insights file
default: SECURITY-INSIGHTS.yml
required:
- filename
# Defines the configuration for ingesting data relevant for the rule
ingest:
type: git
Expand Down
2 changes: 0 additions & 2 deletions rule-types/github/security_insights_dep_policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ def:
description: |
The path to the Security Insights file
default: SECURITY-INSIGHTS.yml
required:
- filename
# Defines the configuration for ingesting data relevant for the rule
ingest:
type: git
Expand Down
2 changes: 0 additions & 2 deletions rule-types/github/security_policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ def:
description: |
Path to the security policy file
default: SECURITY.md
required:
- filename
# Defines the configuration for ingesting data relevant for the rule
ingest:
type: git
Expand Down

0 comments on commit 668f010

Please sign in to comment.