About configuring Dependabot security updates
You can enable Dependabot security updates for any repository that uses Dependabot alerts and the dependency graph. For more information, see Dependabot のセキュリティ アップデート.
You can enable or disable Dependabot security updates for an individual repository, for a selection of repositories in an organization, or for all repositories owned by your personal account or organization. For more information about enabling security features in an organization, see 組織でセキュリティ機能を有効にする.
メモ
リポジトリに対して Dependabot security updates が有効になっている場合、Dependabot は、使用可能なパッチを持つすべての開いている Dependabot アラートを解決するために pull request を自動的に開こうとします。 どのアラートに対して Dependabot が pull request を開くかカスタマイズする場合は、Dependabot security updates を [無効] のままにし、オート トリアージ ルールを作成する必要があります。 詳しくは、「Customizing auto-triage rules to prioritize Dependabot alerts」をご覧ください。
Dependabot とすべての関連する機能は、使用許諾契約でカバーされています。 詳細については、GitHub の Enterprise 顧客契約条件のページを参照してください。
Supported repositories
GitHub automatically enables Dependabot security updates for newly created repositories if your personal account or organization has enabled Automatically enable for new repositories for Dependabot security updates. For more information, see Managing Dependabot security updates for your repositories.
If you create a fork of a repository that has security updates enabled, GitHub will automatically disable Dependabot security updates for the fork. You can then decide whether to enable Dependabot security updates on the specific fork.
If security updates are not enabled for your repository and you don't know why, first try enabling them using the instructions given in the procedural sections below. If security updates are still not working, you can contact GitHub サポート ポータル.
Managing Dependabot security updates for your repositories
You can enable or disable Dependabot security updates for all qualifying repositories owned by your personal account or organization. For more information, see セキュリティと分析機能の管理 or 組織のセキュリティおよび分析設定を管理する.
You can also enable or disable Dependabot security updates for an individual repository.
Enabling or disabling Dependabot security updates for an individual repository
-
GitHub で、リポジトリのメイン ページに移動します。
-
リポジトリ名の下にある [Settings] をクリックします。 [設定] タブが表示されない場合は、 [] ドロップダウン メニューを選び、 [設定] をクリックします。
![タブを示すリポジトリ ヘッダーのスクリーンショット。 [設定] タブが濃いオレンジ色の枠線で強調表示されています。](/assets/cb-28260/images/help/repository/repo-actions-settings.png)
-
サイドバーの [Security] セクションで、[ Advanced Security] をクリックします。
-
To the right of "Dependabot security updates," click Enable to enable the feature or Disable to disable it. For public repositories, the button is disabled if the feature is always enabled.
Grouping Dependabot security updates into a single pull request
To reduce the number of pull requests you may be seeing, you can enable grouped security updates for your repository or organization. When this is enabled, Dependabot will group security updates into one pull request for each package ecosystem. In order to use grouped security updates, you must first enable the following features:
- Dependency graph. For more information, see Configuring the dependency graph.
- Dependabot alerts. For more information, see Configuring Dependabot alerts.
- Dependabot security updates. For more information, see Configuring Dependabot security updates.
メモ
When grouped security updates are first enabled, Dependabot will immediately try to create grouped pull requests. You may notice Dependabot closing old pull requests and opening new ones.
Dependabot security updates のグループ化された pull request は、以下の方法のいずれかまたは両方で有効にすることができます。
- 使用できるセキュリティ更新プログラムをディレクトリ間やエコシステムごとにできるだけ多くグループ化するには、リポジトリ、または organization の [Advanced Security] の [Global settings] の [Advanced Security] 設定でグループ化を有効にします。
- パッケージ名、開発と運用の依存関係、SemVer レベル、複数のディレクトリにわたるエコシステムごとによるグループ化など、グループ化をより細かく制御するには、リポジトリの
dependabot.yml構成ファイルに構成オプションを追加します。
メモ
dependabot.yml ファイル内で Dependabot security updates のグループルールを構成した場合、使用できるすべての更新は、指定したルールに従ってグループ化されます。 Dependabot は、Organization またはリポジトリ レベルでグループ化されたセキュリティ アップデートの設定も有効になっている場合、dependabot.yml で構成されていないディレクトリ間でのみグループ化されます。
Enabling or disabling grouped Dependabot security updates for an individual repository
Repository administrators can enable or disable grouped security updates for their repository. Changing the repository setting will override any default organization settings. dependabot.yml ファイルで構成されたグループ ルールは、Organization またはリポジトリ レベルでグループ化されたセキュリティ アップデートを有効または無効にするためのユーザー インターフェイス設定をオーバーライドします。
-
GitHub で、リポジトリのメイン ページに移動します。
-
リポジトリ名の下にある [Settings] をクリックします。 [設定] タブが表示されない場合は、 [] ドロップダウン メニューを選び、 [設定] をクリックします。
![タブを示すリポジトリ ヘッダーのスクリーンショット。 [設定] タブが濃いオレンジ色の枠線で強調表示されています。](/assets/cb-28260/images/help/repository/repo-actions-settings.png)
-
サイドバーの [Security] セクションで、[ Advanced Security] をクリックします。
-
Under "Dependabot," to the right of "Grouped security updates," click Enable to enable the feature or Disable to disable it.
Enabling or disabling grouped Dependabot security updates for an organization
You can enable grouped Dependabot security updates into a single pull request. For more information, see 組織のグローバル セキュリティ設定の構成.
Overriding the default behavior with a configuration file
You can override the default behavior of Dependabot security updates by adding a dependabot.yml file to your repository. With a dependabot.yml file, you can have more granular control of grouping, and override the default behavior of Dependabot security updates settings.
Use the groups option with the applies-to: security-updates key to create sets of dependencies (per package manager), so that Dependabot opens a single pull request to update multiple dependencies at the same time. You can define groups by package name (the patterns and exclude-patterns keys), dependency type (dependency-type key), and SemVer (the update-types key).
Dependabot は、dependabot.yml ファイルに表示される順序でグループを作成します。 依存関係の更新が複数のグループに属している可能性がある場合、一致する最初のグループにのみ割り当てられます。
If you only require security updates and want to exclude version updates, you can set open-pull-requests-limit to 0 in order to prevent version updates for a given package-ecosystem.
For more information about the configuration options available for security updates, see Customizing pull requests for Dependabot security updates.
# Example configuration file that:
# - Has a private registry
# - Ignores lodash dependency
# - Disables version-updates
# - Defines a group by package name, for security updates for golang dependencies
version: 2
registries:
example:
type: npm-registry
url: https://example.com
token: ${{secrets.NPM_TOKEN}}
updates:
- package-ecosystem: "npm"
directory: "/src/npm-project"
schedule:
interval: "daily"
# For Lodash, ignore all updates
ignore:
- dependency-name: "lodash"
# Disable version updates for npm dependencies
open-pull-requests-limit: 0
registries:
- example
- package-ecosystem: "gomod"
groups:
golang:
applies-to: security-updates
patterns:
- "golang.org*"
# Example configuration file that:
# - Has a private registry
# - Ignores lodash dependency
# - Disables version-updates
# - Defines a group by package name, for security updates for golang dependencies
version: 2
registries:
example:
type: npm-registry
url: https://example.com
token: ${{secrets.NPM_TOKEN}}
updates:
- package-ecosystem: "npm"
directory: "/src/npm-project"
schedule:
interval: "daily"
# For Lodash, ignore all updates
ignore:
- dependency-name: "lodash"
# Disable version updates for npm dependencies
open-pull-requests-limit: 0
registries:
- example
- package-ecosystem: "gomod"
groups:
golang:
applies-to: security-updates
patterns:
- "golang.org*"
メモ
In order for Dependabot to use this configuration for security updates, the directory must be the path to the manifest files, and you should not specify a target-branch.