{"id":3831,"date":"2026-11-14T16:54:08","date_gmt":"2026-11-14T07:54:08","guid":{"rendered":"https:\/\/qol-kk.com\/wp2\/?p=3831"},"modified":"2026-11-14T16:54:08","modified_gmt":"2026-11-14T07:54:08","slug":"20261113-plan096","status":"publish","type":"post","link":"https:\/\/qol-kk.com\/wp2\/blog\/2026\/11\/14\/20261113-plan096\/","title":{"rendered":"GitHub \u306e Branch Protection Rules \u5165\u9580\uff1amain \u3092\u58ca\u3055\u306a\u3044\u305f\u3081\u306e\u6700\u521d\u306e\u8a2d\u5b9a"},"content":{"rendered":"<h2>\u6982\u8981<\/h2>\n<p>\u300cmain \u3078\u306e\u76f4\u63a5 push \u306f\u7981\u6b62\u300d\u300cCI \u304c\u901a\u3063\u3066\u304b\u3089\u30de\u30fc\u30b8\u3059\u308b\u300d\u3068\u3044\u3063\u305f\u904b\u7528\u30eb\u30fc\u30eb\u306f\u3001\u591a\u304f\u306e\u30c1\u30fc\u30e0\u3067\u6c7a\u3081\u3089\u308c\u3066\u3044\u307e\u3059\u3002\u305f\u3060\u3001\u30eb\u30fc\u30eb\u3092\u6c7a\u3081\u305f\u3060\u3051\u3067\u306f\u5b88\u3089\u308c\u307e\u305b\u3093\u3002\u6025\u3044\u3067\u3044\u308b\u3068\u304d\u3084\u3001\u30ed\u30fc\u30ab\u30eb\u306e\u30d6\u30e9\u30f3\u30c1\u3092\u53d6\u308a\u9055\u3048\u305f\u3068\u304d\u306b\u3001\u4e8b\u6545\u306f\u8d77\u304d\u307e\u3059\u3002<\/p>\n<p>GitHub \u306e <strong>Branch Protection Rules\uff08\u30d6\u30e9\u30f3\u30c1\u4fdd\u8b77\u30eb\u30fc\u30eb\uff09<\/strong> \u3092\u4f7f\u3046\u3068\u3001\u3053\u3046\u3057\u305f\u904b\u7528\u30eb\u30fc\u30eb\u3092 GitHub \u5074\u3067\u5f37\u5236\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u6b21\u306e\u5185\u5bb9\u3092\u6271\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>Branch Protection Rules \u3067\u4f55\u3092\u9632\u3052\u308b\u304b<\/li>\n<li>\u6700\u521d\u306b\u5165\u308c\u308b\u3079\u304d\u6700\u5c0f\u69cb\u6210\u3068\u3001\u753b\u9762\u304b\u3089\u306e\u8a2d\u5b9a\u624b\u9806<\/li>\n<li>GitHub Actions \u306e\u30b9\u30c6\u30fc\u30bf\u30b9\u30c1\u30a7\u30c3\u30af\u3092\u5fc5\u9808\u306b\u3059\u308b\u65b9\u6cd5<\/li>\n<li><code>gh api<\/code> \u3067\u8a2d\u5b9a\u3092\u30b3\u30fc\u30c9\u5316\u3059\u308b\u65b9\u6cd5<\/li>\n<li>\u8a2d\u5b9a\u304c\u52b9\u3044\u3066\u3044\u308b\u304b\u306e\u78ba\u8a8d\u65b9\u6cd5\u3068\u3001\u3088\u304f\u3042\u308b\u30cf\u30de\u308a\u3069\u3053\u308d<\/li>\n<\/ul>\n<h2>\u74b0\u5883<\/h2>\n<ul>\n<li>GitHub\uff08github.com\uff09<\/li>\n<li>GitHub Actions\uff08CI \u3068\u3057\u3066\u5229\u7528\uff09<\/li>\n<li>GitHub CLI\uff08<code>gh<\/code>\uff09\u203b\u30b3\u30fc\u30c9\u5316\u3059\u308b\u5834\u5408\u306e\u307f<\/li>\n<\/ul>\n<p>&gt; <strong>\u30d7\u30e9\u30f3\u306b\u3088\u308b\u5236\u7d04<\/strong> &gt; \u30d1\u30d6\u30ea\u30c3\u30af\u30ea\u30dd\u30b8\u30c8\u30ea\u3067\u306f GitHub Free \u3067\u3082\u5229\u7528\u3067\u304d\u307e\u3059\u3002\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u3067\u4f7f\u3046\u5834\u5408\u306f\u3001GitHub Pro \/ Team \/ Enterprise \u306a\u3069\u306e\u6709\u6599\u30d7\u30e9\u30f3\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<h2>\u4fdd\u8b77\u3057\u306a\u3044\u3068\u4f55\u304c\u8d77\u304d\u308b\u304b<\/h2>\n<table>\n<thead>\n<tr>\n<th>\u4e8b\u6545<\/th>\n<th>\u5f71\u97ff<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>main \u3078\u306e\u76f4\u63a5 push<\/td>\n<td>\u30ec\u30d3\u30e5\u30fc\u3082 CI \u3082\u901a\u3089\u306a\u3044\u30b3\u30fc\u30c9\u304c\u5165\u308b\u3002main \u3078\u306e push \u3067\u672c\u756a\u30c7\u30d7\u30ed\u30a4\u304c\u52d5\u304f\u69cb\u6210\u306a\u3089\u3001\u305d\u306e\u307e\u307e\u672c\u756a\u306b\u51fa\u308b<\/td>\n<\/tr>\n<tr>\n<td>CI \u304c\u843d\u3061\u305f\u307e\u307e\u30de\u30fc\u30b8<\/td>\n<td>\u30c6\u30b9\u30c8\u304c\u58ca\u308c\u305f\u72b6\u614b\u304c main \u306b\u6b8b\u308a\u3001\u5f8c\u7d9a\u306e PR \u304c\u3059\u3079\u3066\u5dfb\u304d\u8fbc\u307e\u308c\u308b<\/td>\n<\/tr>\n<tr>\n<td><code>git push --force<\/code><\/td>\n<td>\u4ed6\u306e\u30e1\u30f3\u30d0\u30fc\u306e\u30b3\u30df\u30c3\u30c8\u304c\u5c65\u6b74\u304b\u3089\u6d88\u3048\u308b<\/td>\n<\/tr>\n<tr>\n<td>\u30d6\u30e9\u30f3\u30c1\u306e\u8aa4\u524a\u9664<\/td>\n<td>main \/ release \u30d6\u30e9\u30f3\u30c1\u81ea\u4f53\u304c\u6d88\u3048\u308b<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3069\u306e\u4e8b\u6545\u3082\u3001\u539f\u56e0\u306f\u300c\u4eba\u306e\u6ce8\u610f\u529b\u306b\u983c\u3063\u3066\u3044\u308b\u3053\u3068\u300d\u3067\u3059\u3002\u30eb\u30fc\u30eb\u3092\u6587\u66f8\u5316\u3057\u3066\u3082\u3001\u5f37\u5236\u3059\u308b\u4ed5\u7d44\u307f\u304c\u306a\u3051\u308c\u3070\u3001\u3044\u305a\u308c\u7834\u3089\u308c\u307e\u3059\u3002<\/p>\n<h2>\u6700\u521d\u306b\u5165\u308c\u308b\u3079\u304d\u6700\u5c0f\u69cb\u6210<\/h2>\n<p>\u8a2d\u5b9a\u9805\u76ee\u306f\u305f\u304f\u3055\u3093\u3042\u308a\u307e\u3059\u304c\u3001\u307e\u305a\u306f\u6b21\u306e4\u3064\u3067\u5927\u304d\u306a\u4e8b\u6545\u306f\u307b\u307c\u9632\u3052\u307e\u3059\u3002<\/p>\n<ol>\n<li><strong>Require a pull request before merging<\/strong>\uff08PR \u7d4c\u7531\u306e\u30de\u30fc\u30b8\u3092\u5fc5\u9808\u306b\u3059\u308b\uff09<\/li>\n<li><strong>Require status checks to pass before merging<\/strong>\uff08CI \u306e\u6210\u529f\u3092\u5fc5\u9808\u306b\u3059\u308b\uff09<\/li>\n<li><strong>force push \u3068\u524a\u9664\u3092\u7981\u6b62\u3059\u308b<\/strong>\uff08\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u7981\u6b62\u3002\u8a31\u53ef\u3057\u306a\u3044\u3053\u3068\uff09<\/li>\n<li><strong>Do not allow bypassing the above settings<\/strong>\uff08\u7ba1\u7406\u8005\u3082\u8fc2\u56de\u3067\u304d\u306a\u3044\u3088\u3046\u306b\u3059\u308b\uff09<\/li>\n<\/ol>\n<h2>\u753b\u9762\u304b\u3089\u306e\u8a2d\u5b9a\u624b\u9806<\/h2>\n<ol>\n<li>\u30ea\u30dd\u30b8\u30c8\u30ea\u306e <strong>Settings<\/strong> \u3092\u958b\u304f<\/li>\n<li>\u5de6\u30e1\u30cb\u30e5\u30fc\u306e <strong>Branches<\/strong> \u3092\u9078\u3076<\/li>\n<li><strong>Add branch protection rule<\/strong>\uff08UI \u306b\u3088\u3063\u3066\u306f \"Add classic branch protection rule\"\uff09\u3092\u30af\u30ea\u30c3\u30af<\/li>\n<li><strong>Branch name pattern<\/strong> \u306b <code>main<\/code> \u3068\u5165\u529b<\/li>\n<li>\u4ee5\u4e0b\u306b\u30c1\u30a7\u30c3\u30af\u3092\u5165\u308c\u3066 <strong>Create<\/strong> \u3067\u4fdd\u5b58\u3059\u308b<\/li>\n<\/ol>\n<pre class=\"lang:default decode:true\">[x] Require a pull request before merging\n    [x] Require approvals\uff08\u5fc5\u8981\u306a\u627f\u8a8d\u6570: 1\uff09\n    [x] Dismiss stale pull request approvals when new commits are pushed\n[x] Require status checks to pass before merging\n    [x] Require branches to be up to date before merging\n    \u2192 Status checks that are required \u306b CI \u306e\u30b8\u30e7\u30d6\u540d\u3092\u8ffd\u52a0\n[x] Require conversation resolution before merging\n[x] Do not allow bypassing the above settings\n[ ] Allow force pushes   \u2190 \u30c1\u30a7\u30c3\u30af\u3057\u306a\u3044\n[ ] Allow deletions      \u2190 \u30c1\u30a7\u30c3\u30af\u3057\u306a\u3044<\/pre>\n<h3>\u4e3b\u306a\u8a2d\u5b9a\u9805\u76ee\u306e\u610f\u5473<\/h3>\n<table>\n<thead>\n<tr>\n<th>\u9805\u76ee<\/th>\n<th>\u5185\u5bb9<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Require a pull request before merging<\/td>\n<td>\u76f4\u63a5 push \u3092\u7981\u6b62\u3057\u3001PR \u304b\u3089\u306e\u30de\u30fc\u30b8\u3060\u3051\u3092\u8a31\u53ef\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>Require approvals<\/td>\n<td>\u6307\u5b9a\u3057\u305f\u4eba\u6570\u306e\u627f\u8a8d\u304c\u306a\u3044\u3068\u30de\u30fc\u30b8\u3067\u304d\u306a\u3044<\/td>\n<\/tr>\n<tr>\n<td>Dismiss stale pull request approvals<\/td>\n<td>\u627f\u8a8d\u5f8c\u306b\u65b0\u3057\u3044\u30b3\u30df\u30c3\u30c8\u304c push \u3055\u308c\u305f\u3089\u3001\u627f\u8a8d\u3092\u53d6\u308a\u6d88\u3059<\/td>\n<\/tr>\n<tr>\n<td>Require review from Code Owners<\/td>\n<td><code>CODEOWNERS<\/code> \u306b\u66f8\u304b\u308c\u305f\u62c5\u5f53\u8005\u306e\u627f\u8a8d\u3092\u5fc5\u9808\u306b\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>Require status checks to pass<\/td>\n<td>\u6307\u5b9a\u3057\u305f\u30c1\u30a7\u30c3\u30af\uff08CI\uff09\u304c\u6210\u529f\u3057\u306a\u3044\u3068\u30de\u30fc\u30b8\u3067\u304d\u306a\u3044<\/td>\n<\/tr>\n<tr>\n<td>Require branches to be up to date<\/td>\n<td>\u30d9\u30fc\u30b9\u30d6\u30e9\u30f3\u30c1\u306e\u6700\u65b0\u3092\u53d6\u308a\u8fbc\u3093\u3060\u72b6\u614b\u3067\u30c1\u30a7\u30c3\u30af\u304c\u901a\u308b\u3053\u3068\u3092\u6c42\u3081\u308b<\/td>\n<\/tr>\n<tr>\n<td>Require conversation resolution<\/td>\n<td>\u30ec\u30d3\u30e5\u30fc\u30b3\u30e1\u30f3\u30c8\u304c\u3059\u3079\u3066 Resolve \u3055\u308c\u308b\u307e\u3067\u30de\u30fc\u30b8\u3067\u304d\u306a\u3044<\/td>\n<\/tr>\n<tr>\n<td>Require signed commits<\/td>\n<td>\u7f72\u540d\u4ed8\u304d\u30b3\u30df\u30c3\u30c8\u3060\u3051\u3092\u53d7\u3051\u4ed8\u3051\u308b<\/td>\n<\/tr>\n<tr>\n<td>Require linear history<\/td>\n<td>\u30de\u30fc\u30b8\u30b3\u30df\u30c3\u30c8\u3092\u7981\u6b62\u3059\u308b\uff08squash \/ rebase \u30de\u30fc\u30b8\u306e\u307f\uff09<\/td>\n<\/tr>\n<tr>\n<td>Lock branch<\/td>\n<td>\u30d6\u30e9\u30f3\u30c1\u3092\u8aad\u307f\u53d6\u308a\u5c02\u7528\u306b\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>Do not allow bypassing the above settings<\/td>\n<td>\u7ba1\u7406\u8005\u3092\u542b\u3081\u3001\u8ab0\u3082\u4e0a\u8a18\u306e\u30eb\u30fc\u30eb\u3092\u8fc2\u56de\u3067\u304d\u306a\u304f\u3059\u308b<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\u5b9f\u88c5\u4f8b<\/h2>\n<h3>1. \u5fc5\u9808\u30c1\u30a7\u30c3\u30af\u306b\u3059\u308b CI \u3092\u7528\u610f\u3059\u308b<\/h3>\n<pre class=\"lang:default decode:true\"># .github\/workflows\/ci.yml\nname: CI\n\non:\n  pull_request:\n    branches: [main]\n  push:\n    branches: [main]\n\njobs:\n  test:\n    name: test\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\/checkout@v4\n      - uses: actions\/setup-node@v4\n        with:\n          node-version: 20\n      - run: npm ci\n      - run: npm test<\/pre>\n<p>\u5fc5\u9808\u30c1\u30a7\u30c3\u30af\u3068\u3057\u3066\u767b\u9332\u3059\u308b\u306e\u306f\u3001<strong>\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u540d\u3067\u306f\u306a\u304f\u30b8\u30e7\u30d6\u540d<\/strong>\uff08<code>name:<\/code> \u3092\u6307\u5b9a\u3057\u305f\u5834\u5408\u306f\u305d\u306e\u5024\uff09\u3067\u3059\u3002\u4e0a\u306e\u4f8b\u306a\u3089 <code>test<\/code> \u3092\u767b\u9332\u3057\u307e\u3059\u3002<\/p>\n<p>\u5fc5\u9808\u30c1\u30a7\u30c3\u30af\u306e\u691c\u7d22\u5019\u88dc\u306b\u51fa\u3066\u304f\u308b\u306e\u306f\u3001\u305d\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3067\u6700\u8fd1\u5b9f\u884c\u3055\u308c\u305f\u30c1\u30a7\u30c3\u30af\u3060\u3051\u3067\u3059\u3002\u5019\u88dc\u306b\u51fa\u306a\u3044\u5834\u5408\u306f\u3001\u4e00\u5ea6 PR \u3092\u4f5c\u3063\u3066 CI \u3092\u52d5\u304b\u3057\u3066\u304b\u3089\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>2. <code>gh api<\/code> \u3067\u8a2d\u5b9a\u3092\u30b3\u30fc\u30c9\u5316\u3059\u308b<\/h3>\n<p>\u753b\u9762\u304b\u3089\u8a2d\u5b9a\u3059\u308b\u3068\u3001\u30ea\u30dd\u30b8\u30c8\u30ea\u304c\u5897\u3048\u305f\u3068\u304d\u306b\u8a2d\u5b9a\u304c\u305a\u308c\u3066\u3044\u304d\u307e\u3059\u3002REST API \u3092\u4f7f\u3048\u3070\u3001\u540c\u3058\u8a2d\u5b9a\u3092\u4f55\u5ea6\u3067\u3082\u518d\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">{\n  \"required_status_checks\": {\n    \"strict\": true,\n    \"checks\": [\n      { \"context\": \"test\" }\n    ]\n  },\n  \"enforce_admins\": true,\n  \"required_pull_request_reviews\": {\n    \"dismiss_stale_reviews\": true,\n    \"require_code_owner_reviews\": false,\n    \"required_approving_review_count\": 1\n  },\n  \"restrictions\": null,\n  \"required_linear_history\": true,\n  \"allow_force_pushes\": false,\n  \"allow_deletions\": false,\n  \"required_conversation_resolution\": true\n}<\/pre>\n<p>\u4e0a\u306e JSON \u3092 <code>protection.json<\/code> \u3068\u3057\u3066\u4fdd\u5b58\u3057\u3001\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3067\u9069\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">gh api \\\n  --method PUT \\\n  -H \"Accept: application\/vnd.github+json\" \\\n  repos\/OWNER\/REPO\/branches\/main\/protection \\\n  --input protection.json<\/pre>\n<ul>\n<li><code>strict: true<\/code> \u306f\u300cRequire branches to be up to date\u300d\u306b\u5bfe\u5fdc\u3057\u307e\u3059<\/li>\n<li><code>enforce_admins: true<\/code> \u306f\u300cDo not allow bypassing\u300d\u306b\u5bfe\u5fdc\u3057\u307e\u3059<\/li>\n<li><code>restrictions<\/code> \u306f push \u3067\u304d\u308b\u30e6\u30fc\u30b6\u30fc\u3084\u30c1\u30fc\u30e0\u3092\u5236\u9650\u3059\u308b\u9805\u76ee\u3067\u3059\u3002Organization \u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3067\u306e\u307f\u4f7f\u3048\u307e\u3059\u3002\u4f7f\u308f\u306a\u3044\u5834\u5408\u3082 <code>null<\/code> \u3092\u660e\u793a\u7684\u306b\u6e21\u3059\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059<\/li>\n<\/ul>\n<h2>\u78ba\u8a8d\u65b9\u6cd5<\/h2>\n<h3>\u8a2d\u5b9a\u5185\u5bb9\u3092\u78ba\u8a8d\u3059\u308b<\/h3>\n<pre class=\"lang:default decode:true\">gh api repos\/OWNER\/REPO\/branches\/main\/protection<\/pre>\n<h3>\u76f4\u63a5 push \u304c\u62d2\u5426\u3055\u308c\u308b\u304b\u78ba\u8a8d\u3059\u308b<\/h3>\n<pre class=\"lang:default decode:true\">git switch main\ngit commit --allow-empty -m \"test: branch protection\"\ngit push origin main<\/pre>\n<p>\u4fdd\u8b77\u304c\u52b9\u3044\u3066\u3044\u308c\u3070\u3001<code>protected branch<\/code> \u306b\u95a2\u3059\u308b\u30a8\u30e9\u30fc\u3067 push \u304c\u62d2\u5426\u3055\u308c\u307e\u3059\u3002\u78ba\u8a8d\u304c\u6e08\u3093\u3060\u3089\u3001\u30ed\u30fc\u30ab\u30eb\u306e\u7a7a\u30b3\u30df\u30c3\u30c8\u306f\u53d6\u308a\u6d88\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"lang:default decode:true\">git reset --soft HEAD~1<\/pre>\n<h3>PR \u753b\u9762\u3067\u78ba\u8a8d\u3059\u308b<\/h3>\n<p>PR \u3092\u4f5c\u308b\u3068\u3001\u30de\u30fc\u30b8\u30dc\u30bf\u30f3\u306e\u4e0a\u306b\u5fc5\u9808\u30c1\u30a7\u30c3\u30af\u3068\u627f\u8a8d\u306e\u72b6\u614b\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002\u6761\u4ef6\u3092\u6e80\u305f\u3059\u307e\u3067\u30de\u30fc\u30b8\u30dc\u30bf\u30f3\u306f\u62bc\u305b\u307e\u305b\u3093\u3002<\/p>\n<h2>\u6ce8\u610f\u70b9<\/h2>\n<h3>1. \u5fc5\u9808\u30c1\u30a7\u30c3\u30af\u304c\u300cExpected \u2014 Waiting for status to be reported\u300d\u306e\u307e\u307e\u9032\u307e\u306a\u3044<\/h3>\n<p>\u4e3b\u306a\u539f\u56e0\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<ul>\n<li>\u767b\u9332\u3057\u305f\u30c1\u30a7\u30c3\u30af\u540d\u3068\u30b8\u30e7\u30d6\u540d\u304c\u4e00\u81f4\u3057\u3066\u3044\u306a\u3044\uff08\u30b8\u30e7\u30d6\u540d\u3092\u5909\u3048\u305f\u5f8c\u306b\u8a2d\u5b9a\u3092\u66f4\u65b0\u3057\u3066\u3044\u306a\u3044\uff09<\/li>\n<li>\u30de\u30c8\u30ea\u30af\u30b9\u30b8\u30e7\u30d6\u3067\u3001\u5b9f\u969b\u306e\u30c1\u30a7\u30c3\u30af\u540d\u304c <code>test (20)<\/code> \u306e\u3088\u3046\u306b\u30d1\u30e9\u30e1\u30fc\u30bf\u4ed8\u304d\u306b\u306a\u3063\u3066\u3044\u308b<\/li>\n<li>\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u306e <code>paths<\/code> \u30d5\u30a3\u30eb\u30bf\u3084\u30b8\u30e7\u30d6\u306e <code>if:<\/code> \u6761\u4ef6\u3067\u30b8\u30e7\u30d6\u304c\u5b9f\u884c\u3055\u308c\u305a\u3001\u30c1\u30a7\u30c3\u30af\u7d50\u679c\u304c\u5831\u544a\u3055\u308c\u306a\u3044<\/li>\n<\/ul>\n<p>\u6700\u5f8c\u306e\u30b1\u30fc\u30b9\u3067\u306f\u3001\u5fc5\u9808\u30c1\u30a7\u30c3\u30af\u306f\u300c\u7d50\u679c\u5f85\u3061\u300d\u306e\u307e\u307e\u6b62\u307e\u308a\u307e\u3059\u3002\u30d1\u30b9\u3067\u5b9f\u884c\u3092\u5206\u3051\u3066\u3044\u308b\u30b8\u30e7\u30d6\u3092\u5fc5\u9808\u306b\u3057\u306a\u3044\u3001\u307e\u305f\u306f\u5e38\u306b\u5b9f\u884c\u3055\u308c\u308b\u96c6\u7d04\u30b8\u30e7\u30d6\u30921\u3064\u4f5c\u3063\u3066\u305d\u308c\u3060\u3051\u3092\u5fc5\u9808\u306b\u3059\u308b\u3001\u3068\u3044\u3063\u305f\u5bfe\u7b56\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3>2. 1\u4eba\u958b\u767a\u3067\u627f\u8a8d\u3092\u5fc5\u9808\u306b\u3059\u308b\u3068\u3001\u81ea\u5206\u3067\u8a70\u3080<\/h3>\n<p>GitHub \u3067\u306f\u81ea\u5206\u306e PR \u3092\u81ea\u5206\u3067\u627f\u8a8d\u3067\u304d\u307e\u305b\u3093\u30021\u4eba\u3067\u958b\u767a\u3059\u308b\u5834\u5408\u306f\u3001\u6b21\u306e\u69cb\u6210\u304c\u73fe\u5b9f\u7684\u3067\u3059\u3002<\/p>\n<ul>\n<li><strong>Require a pull request<\/strong> \u306f\u6709\u52b9\uff08\u76f4\u63a5 push \u3092\u9632\u3050\uff09<\/li>\n<li><strong>Require approvals<\/strong> \u306f\u7121\u52b9<\/li>\n<li><strong>Require status checks<\/strong> \u306f\u6709\u52b9\uff08CI \u3060\u3051\u306f\u5fc5\u305a\u901a\u3059\uff09<\/li>\n<\/ul>\n<h3>3. \u7ba1\u7406\u8005\u306f\u8fc2\u56de\u3067\u304d\u308b\uff08\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\uff09<\/h3>\n<p>\u300cDo not allow bypassing the above settings\u300d\u3092\u6709\u52b9\u306b\u3057\u306a\u3044\u3068\u3001\u7ba1\u7406\u8005\u6a29\u9650\u3092\u6301\u3064\u30e6\u30fc\u30b6\u30fc\u306f\u30eb\u30fc\u30eb\u3092\u7121\u8996\u3057\u3066 push \u3084\u30de\u30fc\u30b8\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>4. Rulesets \u3068\u3044\u3046\u65b0\u3057\u3044\u4ed5\u7d44\u307f\u3082\u3042\u308b<\/h3>\n<p>GitHub \u306b\u306f\u3001Branch Protection Rules \u306e\u5f8c\u7d99\u306b\u3042\u305f\u308b <strong>Rulesets<\/strong>\uff08Settings \u2192 Rules \u2192 Rulesets\uff09\u3082\u3042\u308a\u307e\u3059\u3002\u8907\u6570\u306e\u30eb\u30fc\u30eb\u3092\u91cd\u306d\u3066\u9069\u7528\u3067\u304d\u308b\u3001Organization \u5168\u4f53\u306b\u4e00\u62ec\u3067\u9069\u7528\u3067\u304d\u308b\u3001\u3068\u3044\u3063\u305f\u7279\u5fb4\u304c\u3042\u308a\u307e\u3059\u3002\u591a\u6570\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u307e\u3068\u3081\u3066\u7ba1\u7406\u3059\u308b\u5834\u5408\u306f\u3001Rulesets \u3082\u691c\u8a0e\u3059\u308b\u3068\u3088\u3044\u3067\u3057\u3087\u3046\u3002\u8003\u3048\u65b9\u306f\u540c\u3058\u306a\u306e\u3067\u3001\u672c\u8a18\u4e8b\u306e\u5185\u5bb9\u306f\u305d\u306e\u307e\u307e\u5f79\u7acb\u3061\u307e\u3059\u3002<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<ul>\n<li>Branch Protection Rules \u306f\u300c\u904b\u7528\u30eb\u30fc\u30eb\u3092 GitHub \u306b\u5f37\u5236\u3055\u305b\u308b\u300d\u305f\u3081\u306e\u6a5f\u80fd<\/li>\n<li>\u6700\u521d\u306f <strong>PR \u5fc5\u9808\u30fb\u30b9\u30c6\u30fc\u30bf\u30b9\u30c1\u30a7\u30c3\u30af\u5fc5\u9808\u30fbforce push\/\u524a\u9664\u7981\u6b62\u30fb\u7ba1\u7406\u8005\u3082\u8fc2\u56de\u4e0d\u53ef<\/strong> \u306e4\u70b9\u304b\u3089\u59cb\u3081\u308b<\/li>\n<li>\u5fc5\u9808\u30c1\u30a7\u30c3\u30af\u306f<strong>\u30b8\u30e7\u30d6\u540d<\/strong>\u3067\u767b\u9332\u3059\u308b\u3002<code>paths<\/code> \u30d5\u30a3\u30eb\u30bf\u3068\u306e\u7d44\u307f\u5408\u308f\u305b\u306b\u6ce8\u610f\u3059\u308b<\/li>\n<li>1\u4eba\u958b\u767a\u3067\u306f\u627f\u8a8d\u5fc5\u9808\u3092\u5916\u3057\u3001CI \u5fc5\u9808\u3060\u3051\u3092\u6b8b\u3059<\/li>\n<li>\u8a2d\u5b9a\u306f <code>gh api<\/code> \u3067\u30b3\u30fc\u30c9\u5316\u3057\u3066\u304a\u304f\u3068\u3001\u8907\u6570\u30ea\u30dd\u30b8\u30c8\u30ea\u3067\u3082\u63c3\u3048\u3084\u3059\u3044<\/li>\n<\/ul>\n<p>\u300c\u6c17\u3092\u3064\u3051\u308b\u300d\u3092\u300c\u4ed5\u7d44\u307f\u3067\u9632\u3050\u300d\u306b\u7f6e\u304d\u63db\u3048\u308b\u306e\u304c\u3001CI\/CD \u306e\u7b2c\u4e00\u6b69\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u300cmain \u3078\u306e\u76f4\u63a5 push \u306f\u7981\u6b62\u300d\u300cCI \u304c\u901a\u3063\u3066\u304b\u3089\u30de\u30fc\u30b8\u3059\u308b\u300d\u3068\u3044\u3063\u305f\u904b\u7528\u30eb\u30fc\u30eb\u306f\u3001\u591a\u304f\u306e\u30c1\u30fc\u30e0\u3067\u6c7a\u3081\u3089\u308c\u3066\u3044\u307e\u3059\u3002\u305f\u3060\u3001\u30eb\u30fc\u30eb\u3092\u6c7a\u3081\u305f\u3060\u3051\u3067\u306f\u5b88\u3089\u308c\u307e\u305b\u3093\u3002\u6025\u3044\u3067\u3044\u308b\u3068\u304d\u3084\u3001\u30ed\u30fc\u30ab\u30eb\u306e\u30d6\u30e9\u30f3\u30c1\u3092\u53d6\u308a\u9055\u3048\u305f\u3068\u304d\u306b\u3001\u4e8b\u6545\u306f\u8d77\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":3830,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"","vkexunit_cta_each_option":"","_lightning_design_setting":[],"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1179],"tags":[1189,1162],"class_list":["post-3831","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ci-cd","tag-github-actions","tag-1162"],"veu_head_title_object":{"title":"","add_site_title":""},"jetpack_publicize_connections":[],"jetpack-related-posts":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/qol-kk.com\/wp2\/wp-content\/uploads\/2026\/11\/20261113-plan096-thumbnail.jpg","_links":{"self":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/posts\/3831","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/comments?post=3831"}],"version-history":[{"count":1,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/posts\/3831\/revisions"}],"predecessor-version":[{"id":3835,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/posts\/3831\/revisions\/3835"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/media\/3830"}],"wp:attachment":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/media?parent=3831"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/categories?post=3831"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/tags?post=3831"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}