From aae6826fc2c7f824a7e3b9de3176fe94d0782c51 Mon Sep 17 00:00:00 2001 From: Juan Antonio Osorio Date: Fri, 15 Nov 2024 08:59:41 +0200 Subject: [PATCH] Remove `required` branch from branch protection rules and use default 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 --- rule-types/github/branch_protection_allow_deletions.yaml | 3 +-- rule-types/github/branch_protection_allow_force_pushes.yaml | 3 +-- rule-types/github/branch_protection_allow_fork_syncing.yaml | 3 +-- rule-types/github/branch_protection_enabled.yaml | 3 +-- rule-types/github/branch_protection_enforce_admins.yaml | 3 +-- rule-types/github/branch_protection_lock_branch.yaml | 3 +-- .../branch_protection_require_conversation_resolution.yaml | 3 +-- .../github/branch_protection_require_linear_history.yaml | 3 +-- ...protection_require_pull_request_approving_review_count.yaml | 3 +-- ...nch_protection_require_pull_request_code_owners_review.yaml | 3 +-- ..._protection_require_pull_request_dismiss_stale_reviews.yaml | 3 +-- ...nch_protection_require_pull_request_last_push_approval.yaml | 3 +-- rule-types/github/branch_protection_require_pull_requests.yaml | 3 +-- rule-types/github/branch_protection_require_signatures.yaml | 3 +-- 14 files changed, 14 insertions(+), 28 deletions(-) diff --git a/rule-types/github/branch_protection_allow_deletions.yaml b/rule-types/github/branch_protection_allow_deletions.yaml index 032d18a..54912d4 100644 --- a/rule-types/github/branch_protection_allow_deletions.yaml +++ b/rule-types/github/branch_protection_allow_deletions.yaml @@ -29,8 +29,7 @@ def: branch: type: string description: "The name of the branch to check. If left empty, the default branch will be used." - required: - - branch + default: "" # Defines the schema for writing a rule with this rule being checked rule_schema: type: object diff --git a/rule-types/github/branch_protection_allow_force_pushes.yaml b/rule-types/github/branch_protection_allow_force_pushes.yaml index 19e56df..f1a36ba 100644 --- a/rule-types/github/branch_protection_allow_force_pushes.yaml +++ b/rule-types/github/branch_protection_allow_force_pushes.yaml @@ -30,8 +30,7 @@ def: branch: type: string description: "The name of the branch to check. If left empty, the default branch will be used." - required: - - branch + default: "" # Defines the schema for writing a rule with this rule being checked rule_schema: type: object diff --git a/rule-types/github/branch_protection_allow_fork_syncing.yaml b/rule-types/github/branch_protection_allow_fork_syncing.yaml index 706ebed..04b2bcd 100644 --- a/rule-types/github/branch_protection_allow_fork_syncing.yaml +++ b/rule-types/github/branch_protection_allow_fork_syncing.yaml @@ -30,8 +30,7 @@ def: branch: type: string description: "The name of the branch to check. If left empty, the default branch will be used." - required: - - branch + default: "" # Defines the schema for writing a rule with this rule being checked rule_schema: properties: diff --git a/rule-types/github/branch_protection_enabled.yaml b/rule-types/github/branch_protection_enabled.yaml index 81359b3..8368d24 100644 --- a/rule-types/github/branch_protection_enabled.yaml +++ b/rule-types/github/branch_protection_enabled.yaml @@ -31,8 +31,7 @@ def: branch: type: string description: "The name of the branch to check. If left empty, the default branch will be used." - required: - - branch + default: "" rule_schema: {} # Defines the configuration for ingesting data relevant for the rule ingest: diff --git a/rule-types/github/branch_protection_enforce_admins.yaml b/rule-types/github/branch_protection_enforce_admins.yaml index ee75aaf..36e259c 100644 --- a/rule-types/github/branch_protection_enforce_admins.yaml +++ b/rule-types/github/branch_protection_enforce_admins.yaml @@ -27,8 +27,7 @@ def: branch: type: string description: "The name of the branch to check. If left empty, the default branch will be used." - required: - - branch + default: "" # Defines the schema for writing a rule with this rule being checked rule_schema: properties: diff --git a/rule-types/github/branch_protection_lock_branch.yaml b/rule-types/github/branch_protection_lock_branch.yaml index 9d106b0..be57f61 100644 --- a/rule-types/github/branch_protection_lock_branch.yaml +++ b/rule-types/github/branch_protection_lock_branch.yaml @@ -29,8 +29,7 @@ def: branch: type: string description: "The name of the branch to check. If left empty, the default branch will be used." - required: - - branch + default: "" # Defines the schema for writing a rule with this rule being checked rule_schema: properties: diff --git a/rule-types/github/branch_protection_require_conversation_resolution.yaml b/rule-types/github/branch_protection_require_conversation_resolution.yaml index a358bf8..345bedd 100644 --- a/rule-types/github/branch_protection_require_conversation_resolution.yaml +++ b/rule-types/github/branch_protection_require_conversation_resolution.yaml @@ -31,8 +31,7 @@ def: branch: type: string description: "The name of the branch to check. If left empty, the default branch will be used." - required: - - branch + default: "" # Defines the schema for writing a rule with this rule being checked rule_schema: properties: diff --git a/rule-types/github/branch_protection_require_linear_history.yaml b/rule-types/github/branch_protection_require_linear_history.yaml index 44c164f..0a41bd3 100644 --- a/rule-types/github/branch_protection_require_linear_history.yaml +++ b/rule-types/github/branch_protection_require_linear_history.yaml @@ -29,8 +29,7 @@ def: branch: type: string description: "The name of the branch to check. If left empty, the default branch will be used." - required: - - branch + default: "" # Defines the schema for writing a rule with this rule being checked rule_schema: properties: diff --git a/rule-types/github/branch_protection_require_pull_request_approving_review_count.yaml b/rule-types/github/branch_protection_require_pull_request_approving_review_count.yaml index 4a8a11a..e1ce039 100644 --- a/rule-types/github/branch_protection_require_pull_request_approving_review_count.yaml +++ b/rule-types/github/branch_protection_require_pull_request_approving_review_count.yaml @@ -30,8 +30,7 @@ def: branch: type: string description: "The name of the branch to check. If left empty, the default branch will be used." - required: - - branch + default: "" # Defines the schema for writing a rule with this rule being checked rule_schema: properties: diff --git a/rule-types/github/branch_protection_require_pull_request_code_owners_review.yaml b/rule-types/github/branch_protection_require_pull_request_code_owners_review.yaml index a14db65..2569699 100644 --- a/rule-types/github/branch_protection_require_pull_request_code_owners_review.yaml +++ b/rule-types/github/branch_protection_require_pull_request_code_owners_review.yaml @@ -31,8 +31,7 @@ def: branch: type: string description: "The name of the branch to check. If left empty, the default branch will be used." - required: - - branch + default: "" # Defines the schema for writing a rule with this rule being checked rule_schema: properties: diff --git a/rule-types/github/branch_protection_require_pull_request_dismiss_stale_reviews.yaml b/rule-types/github/branch_protection_require_pull_request_dismiss_stale_reviews.yaml index f7f0ccb..05542e5 100644 --- a/rule-types/github/branch_protection_require_pull_request_dismiss_stale_reviews.yaml +++ b/rule-types/github/branch_protection_require_pull_request_dismiss_stale_reviews.yaml @@ -30,8 +30,7 @@ def: branch: type: string description: "The name of the branch to check. If left empty, the default branch will be used." - required: - - branch + default: "" # Defines the schema for writing a rule with this rule being checked rule_schema: properties: diff --git a/rule-types/github/branch_protection_require_pull_request_last_push_approval.yaml b/rule-types/github/branch_protection_require_pull_request_last_push_approval.yaml index 8cff1ff..5c9f830 100644 --- a/rule-types/github/branch_protection_require_pull_request_last_push_approval.yaml +++ b/rule-types/github/branch_protection_require_pull_request_last_push_approval.yaml @@ -30,8 +30,7 @@ def: branch: type: string description: "The name of the branch to check. If left empty, the default branch will be used." - required: - - branch + default: "" # Defines the schema for writing a rule with this rule being checked rule_schema: properties: diff --git a/rule-types/github/branch_protection_require_pull_requests.yaml b/rule-types/github/branch_protection_require_pull_requests.yaml index b53efc1..94cae70 100644 --- a/rule-types/github/branch_protection_require_pull_requests.yaml +++ b/rule-types/github/branch_protection_require_pull_requests.yaml @@ -30,8 +30,7 @@ def: branch: type: string description: "The name of the branch to check. If left empty, the default branch will be used." - required: - - branch + default: "" # Defines the schema for writing a rule with this rule being checked rule_schema: properties: diff --git a/rule-types/github/branch_protection_require_signatures.yaml b/rule-types/github/branch_protection_require_signatures.yaml index 3b7134d..de15f1d 100644 --- a/rule-types/github/branch_protection_require_signatures.yaml +++ b/rule-types/github/branch_protection_require_signatures.yaml @@ -29,8 +29,7 @@ def: branch: type: string description: "The name of the branch to check. If left empty, the default branch will be used." - required: - - branch + default: "" # Defines the schema for writing a rule with this rule being checked rule_schema: type: object