From b5a270e671cc60a154c4903f9058f88368c0e9a1 Mon Sep 17 00:00:00 2001 From: Amon Sawamura Date: Sat, 31 Jan 2026 16:30:29 +0900 Subject: [PATCH 1/4] Add GitHub rulesets for core branches protection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Core branches (main/dev) の保護ルールセットを追加。 - ブランチの削除を禁止 - Force push を禁止 - PR 必須(承認数は0でOK) - マージ方法は通常の merge のみ許可 Co-Authored-By: Claude Sonnet 4.5 --- .../core-branches-protectionruleset.json | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 github/rulesets/core-branches-protectionruleset.json diff --git a/github/rulesets/core-branches-protectionruleset.json b/github/rulesets/core-branches-protectionruleset.json new file mode 100644 index 0000000..ff834a4 --- /dev/null +++ b/github/rulesets/core-branches-protectionruleset.json @@ -0,0 +1,41 @@ +{ + "id": 0, + "name": "Core branches protection ruleset", + "target": "branch", + "source_type": "Repository", + "source": "", + "enforcement": "active", + "conditions": { + "ref_name": { + "exclude": [], + "include": [ + "refs/heads/main", + "refs/heads/dev", + "~DEFAULT_BRANCH" + ] + } + }, + "rules": [ + { + "type": "deletion" + }, + { + "type": "non_fast_forward" + }, + { + "type": "pull_request", + "parameters": { + "required_approving_review_count": 0, + "dismiss_stale_reviews_on_push": false, + "required_reviewers": [], + "require_code_owner_review": false, + "require_last_push_approval": false, + "required_review_thread_resolution": false, + "allowed_merge_methods": [ + "merge" + ] + } + } + ], + "bypass_actors": [] +} From e7ecad2ba914beb8458fe119e551dba86c353875 Mon Sep 17 00:00:00 2001 From: Amon Sawamura Date: Sat, 31 Jan 2026 17:00:11 +0900 Subject: [PATCH 2/4] fix format --- github/rulesets/core-branches-protectionruleset.json | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/github/rulesets/core-branches-protectionruleset.json b/github/rulesets/core-branches-protectionruleset.json index ff834a4..2742e42 100644 --- a/github/rulesets/core-branches-protectionruleset.json +++ b/github/rulesets/core-branches-protectionruleset.json @@ -8,11 +8,7 @@ "conditions": { "ref_name": { "exclude": [], - "include": [ - "refs/heads/main", - "refs/heads/dev", - "~DEFAULT_BRANCH" - ] + "include": ["refs/heads/main", "refs/heads/dev", "~DEFAULT_BRANCH"] } }, "rules": [ @@ -31,9 +27,7 @@ "require_code_owner_review": false, "require_last_push_approval": false, "required_review_thread_resolution": false, - "allowed_merge_methods": [ - "merge" - ] + "allowed_merge_methods": ["merge"] } } ], From 0e4b2229a6ac378359e6fd448925b3164f671ef1 Mon Sep 17 00:00:00 2001 From: Amon Sawamura Date: Sat, 31 Jan 2026 17:01:17 +0900 Subject: [PATCH 3/4] Remove response-only fields from ruleset JSON Remove id, source_type, and source fields which are returned by GitHub API but should not be included in request payloads. Co-Authored-By: Claude Sonnet 4.5 --- github/rulesets/core-branches-protectionruleset.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/github/rulesets/core-branches-protectionruleset.json b/github/rulesets/core-branches-protectionruleset.json index 2742e42..659d654 100644 --- a/github/rulesets/core-branches-protectionruleset.json +++ b/github/rulesets/core-branches-protectionruleset.json @@ -1,9 +1,6 @@ { - "id": 0, "name": "Core branches protection ruleset", "target": "branch", - "source_type": "Repository", - "source": "", "enforcement": "active", "conditions": { "ref_name": { From 0db8070fe12964975da48434d1755d1e9abe5c75 Mon Sep 17 00:00:00 2001 From: Amon Sawamura Date: Sat, 31 Jan 2026 17:02:03 +0900 Subject: [PATCH 4/4] change order --- github/rulesets/core-branches-protectionruleset.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/github/rulesets/core-branches-protectionruleset.json b/github/rulesets/core-branches-protectionruleset.json index 659d654..94285e4 100644 --- a/github/rulesets/core-branches-protectionruleset.json +++ b/github/rulesets/core-branches-protectionruleset.json @@ -2,6 +2,7 @@ "name": "Core branches protection ruleset", "target": "branch", "enforcement": "active", + "bypass_actors": [], "conditions": { "ref_name": { "exclude": [], @@ -27,6 +28,5 @@ "allowed_merge_methods": ["merge"] } } - ], - "bypass_actors": [] + ] }