複数のエコシステムの更新により、Dependabot を統合して、異なるパッケージ エコシステム間の要求をグループごとに 1 つの PR にプルできます。 「マルチエコシステム更新」を参照してください。
前提条件
- 複数のパッケージ エコシステムに依存関係があるリポジトリ
- 既存の
.github/dependabot.ymlファイル。 「Dependabot バージョンの更新の構成」を参照してください。
1. .github/dependabot.yml ファイルでマルチエコシステム グループを定義する
まず、最上位の multi-ecosystem-groups セクションで、スケジュールを含むグループを定義します。
version: 2
multi-ecosystem-groups:
infrastructure:
schedule:
interval: "weekly"
updates:
# Your existing package ecosystems will go here
version: 2
multi-ecosystem-groups:
infrastructure:
schedule:
interval: "weekly"
updates:
# Your existing package ecosystems will go here
2. エコシステムをグループに割り当てる
`multi-ecosystem-groups`キーとパターンをパッケージ エコシステムの構成に追加します。
version: 2
multi-ecosystem-groups:
infrastructure:
schedule:
interval: "weekly"
updates:
- package-ecosystem: "docker"
directory: "/"
patterns: ["nginx", "redis", "postgres"]
multi-ecosystem-group: "infrastructure"
- package-ecosystem: "terraform"
directory: "/"
patterns: ["aws", "terraform-*"]
multi-ecosystem-group: "infrastructure"
version: 2
multi-ecosystem-groups:
infrastructure:
schedule:
interval: "weekly"
updates:
- package-ecosystem: "docker"
directory: "/"
patterns: ["nginx", "redis", "postgres"]
multi-ecosystem-group: "infrastructure"
- package-ecosystem: "terraform"
directory: "/"
patterns: ["aws", "terraform-*"]
multi-ecosystem-group: "infrastructure"
メモ
`["*"]`を使用して、すべての依存関係を含めます。
3. 変更をコミットする
`dependabot.yml` ファイルへの変更をコミットします。
4. 追加のキーを使用してカスタマイズする (省略可能)
ラベル、レビュー担当者、またはその他の構成オプションを複数のエコシステム グループに追加できます。 「 assignees と labels」を参照してください。
multi-ecosystem-groups:
infrastructure:
schedule:
interval: "weekly"
assignees: ["@platform-team"]
labels: ["infrastructure", "dependencies"]
updates:
- package-ecosystem: "docker"
directory: "/"
patterns: ["nginx", "redis", "postgres"]
multi-ecosystem-group: "infrastructure"
- package-ecosystem: "terraform"
directory: "/"
patterns: ["aws", "terraform-*"]
multi-ecosystem-group: "infrastructure"
multi-ecosystem-groups:
infrastructure:
schedule:
interval: "weekly"
assignees: ["@platform-team"]
labels: ["infrastructure", "dependencies"]
updates:
- package-ecosystem: "docker"
directory: "/"
patterns: ["nginx", "redis", "postgres"]
multi-ecosystem-group: "infrastructure"
- package-ecosystem: "terraform"
directory: "/"
patterns: ["aws", "terraform-*"]
multi-ecosystem-group: "infrastructure"
使用可能なオプションの完全な一覧については、 AUTOTITLE を参照してください。
5. 構成を確認する
変更をコミットしたら、構成を確認できます。
- リポジトリの [分析情報 ] タブに移動します。
-
**依存関係グラフ**を選択して、次に **Dependabot** を選択します。 - 複数のエコシステム グループが一覧に表示されたことを確認します。
次回、スケジュールされた更新が実行されると、グループ内のすべてのエコシステムからの更新を含む 1 つのプル要求を受け取ります。
Troubleshooting
統合されたプル要求が表示されない場合は、次のことを確認します。
*
patterns キーは、エコシステムごとに定義されます (multi-ecosystem-groupを使用する場合に必要)。
- すべてのエコシステムでは、
multi-ecosystem-groupフィールドで同じグループ名が使用されます。
詳細については、次を参照してください。
-
[AUTOTITLE](/code-security/dependabot/working-with-dependabot/dependabot-options-reference)