Skip to content

Commit 5e9722f

Browse files
authored
Remove required branch from branch protection rules and use default (#214)
This makes it so that branch protection rules no longer have a `required` parameter. Instead, this is replaced by a default value of `""` Signed-off-by: Juan Antonio Osorio <ozz@stacklok.com>
1 parent a26b919 commit 5e9722f

14 files changed

Lines changed: 14 additions & 28 deletions

rule-types/github/branch_protection_allow_deletions.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ def:
2929
branch:
3030
type: string
3131
description: "The name of the branch to check. If left empty, the default branch will be used."
32-
required:
33-
- branch
32+
default: ""
3433
# Defines the schema for writing a rule with this rule being checked
3534
rule_schema:
3635
type: object

rule-types/github/branch_protection_allow_force_pushes.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ def:
3030
branch:
3131
type: string
3232
description: "The name of the branch to check. If left empty, the default branch will be used."
33-
required:
34-
- branch
33+
default: ""
3534
# Defines the schema for writing a rule with this rule being checked
3635
rule_schema:
3736
type: object

rule-types/github/branch_protection_allow_fork_syncing.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ def:
3030
branch:
3131
type: string
3232
description: "The name of the branch to check. If left empty, the default branch will be used."
33-
required:
34-
- branch
33+
default: ""
3534
# Defines the schema for writing a rule with this rule being checked
3635
rule_schema:
3736
properties:

rule-types/github/branch_protection_enabled.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ def:
3131
branch:
3232
type: string
3333
description: "The name of the branch to check. If left empty, the default branch will be used."
34-
required:
35-
- branch
34+
default: ""
3635
rule_schema: {}
3736
# Defines the configuration for ingesting data relevant for the rule
3837
ingest:

rule-types/github/branch_protection_enforce_admins.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ def:
2727
branch:
2828
type: string
2929
description: "The name of the branch to check. If left empty, the default branch will be used."
30-
required:
31-
- branch
30+
default: ""
3231
# Defines the schema for writing a rule with this rule being checked
3332
rule_schema:
3433
properties:

rule-types/github/branch_protection_lock_branch.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ def:
2929
branch:
3030
type: string
3131
description: "The name of the branch to check. If left empty, the default branch will be used."
32-
required:
33-
- branch
32+
default: ""
3433
# Defines the schema for writing a rule with this rule being checked
3534
rule_schema:
3635
properties:

rule-types/github/branch_protection_require_conversation_resolution.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ def:
3131
branch:
3232
type: string
3333
description: "The name of the branch to check. If left empty, the default branch will be used."
34-
required:
35-
- branch
34+
default: ""
3635
# Defines the schema for writing a rule with this rule being checked
3736
rule_schema:
3837
properties:

rule-types/github/branch_protection_require_linear_history.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ def:
2929
branch:
3030
type: string
3131
description: "The name of the branch to check. If left empty, the default branch will be used."
32-
required:
33-
- branch
32+
default: ""
3433
# Defines the schema for writing a rule with this rule being checked
3534
rule_schema:
3635
properties:

rule-types/github/branch_protection_require_pull_request_approving_review_count.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ def:
3030
branch:
3131
type: string
3232
description: "The name of the branch to check. If left empty, the default branch will be used."
33-
required:
34-
- branch
33+
default: ""
3534
# Defines the schema for writing a rule with this rule being checked
3635
rule_schema:
3736
properties:

rule-types/github/branch_protection_require_pull_request_code_owners_review.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ def:
3131
branch:
3232
type: string
3333
description: "The name of the branch to check. If left empty, the default branch will be used."
34-
required:
35-
- branch
34+
default: ""
3635
# Defines the schema for writing a rule with this rule being checked
3736
rule_schema:
3837
properties:

0 commit comments

Comments
 (0)