Skip to main content
ドキュメントへの更新が頻繁に発行されており、このページの翻訳はまだ行われている場合があります。 最新の情報については、「英語のドキュメント」を参照してください。

Configuring access to private registries for Dependabot

You can configure Dependabot to access dependencies stored in private registries. You can store authentication information, like passwords and access tokens, as encrypted secrets and then reference these in the Dependabot configuration file.

About private registries

Dependabot version updates keeps your dependencies up-to-date. Dependabot can access public registries. In addition, you can give Dependabot version updates access to private package registries and private GitHub repositories so that you can keep your private and innersource dependencies as up-to-date as your public dependencies.

In most ecosystems, private dependencies are usually published to private package registries. These private registries are similar to their public equivalents, but they require authentication.

Configuring private registries

You configure Dependabot's access to private registries in the dependabot.yml file. The top-level registries key is optional and specifies authentication details. registries"*" に設定することで、定義されたすべてのリポジトリを使用できるようにすることができます。 また、更新が使用できるレジストリをリストすることもできます。 これを行うには、dependabot.yml ファイルの最上位の registries セクションで定義されているレジストリの名前を使います。

以下のオプションを使用して、アクセス設定を指定します。 レジストリの設定には、typeurl、そして通常は usernamepassword の組み合わせまたは token を含める必要があります。

オプション                説明
typeレジストリのタイプを指定します。 タイプの一覧については下記をご覧ください。
urlこのレジストリの依存関係にアクセスするために使用する URL。 プロトコルはオプションです。 指定しないと、https:// が想定されます。 Dependabot が必要に応じて末尾のスラッシュを追加または無視します。
usernameDependabot がレジストリにアクセスするために使用するユーザ名。
password指定したユーザのパスワードを含む Dependabot シークレットへのリファレンス。 詳しくは、「Configuring access to private registries for Dependabot」を参照してください。
keyこのレジストリへのアクセスキーを含むDependabotシークレットへの参照 詳しくは、「Configuring access to private registries for Dependabot」を参照してください。
tokenこのレジストリへのアクセストークンを含む Dependabot シークレットへのリファレンス。 詳しくは、「Configuring access to private registries for Dependabot」を参照してください。
replaces-baseレジストリ では、ブール値が true の場合、pip では Python Package Index のベース URL (既定では https://pypi.org/simple) ではなく、指定された URL を使って依存関係を解決します。

For more information about the configuration options that are available, how to use them, and about the supported types, see "dependabot.yml ファイルの構成オプション."

Storing credentials for Dependabot to use

To give Dependabot access to the private registries supported by GitHub, you store the registry’s access token or secret in the secret store for your repository or organization.

About encrypted secrets for Dependabot

Dependabot secrets are encrypted credentials that you create at either the organization level or the repository level. When you add a secret at the organization level, you can specify which repositories can access the secret. You can use secrets to allow Dependabot to update dependencies located in private package registries. When you add a secret, it's encrypted before it reaches GitHub and it remains encrypted until it's used by Dependabot to access a private package registry.

Dependabot secrets also include secrets that are used by GitHub Actions workflows triggered by Dependabot pull requests. Dependabot itself may not use these secrets, but the workflows require them. For more information, see "GitHub ActionsでのDependabotの自動化."

After you add a Dependabot secret, you can reference it in the dependabot.yml configuration file like this: ${{secrets.NAME}}, where "NAME" is the name you chose for the secret. For example:

password: ${{secrets.MY_ARTIFACTORY_PASSWORD}}

For more information, see "dependabot.yml ファイルの構成オプション."

Naming your secrets

The name of a Dependabot secret:

  • Can only contain alphanumeric characters ([A-Z], [0-9]) or underscores (_). Spaces are not allowed. If you enter lowercase letters these are changed to uppercase.
  • Must not start with the GITHUB_ prefix.
  • Must not start with a number.

Adding a repository secret for Dependabot

個人アカウントのリポジトリにシークレットを作成するには、そのリポジトリのオーナーでなければなりません。 組織リポジトリのシークレットを作成するには、admin アクセス権が必要です。

  1. お使いの GitHub Enterprise Server インスタンス で、リポジトリのメイン ページへ移動します。

  2. リポジトリ名の下にある [設定] をクリックします。 [セキュリティ] タブが表示されない場合は、 [] ドロップダウン メニューを選び、 [設定] をクリックします。

    タブを示すリポジトリ ヘッダーのスクリーンショット。 [設定] タブが濃いオレンジ色の枠線で強調表示されています。

  3. サイドバーの [セキュリティ] セクションで、 [シークレット] の順に選んだら、 [Dependabot] をクリックします。

  4. Click New repository secret.

  5. Type a name for your secret in the Name input box.

  6. Enter the value for your secret.

  7. Click Add secret.

    The name of the secret is listed on the Dependabot secrets page. You can click Update to change the secret value. You can click Remove to delete the secret.

Adding an organization secret for Dependabot

When creating a secret in an organization, you can use a policy to limit which repositories can access that secret. For example, you can grant access to all repositories, or limit access to only private repositories or a specified list of repositories.

組織レベルでシークレットを作成するには、admin アクセス権が必要です。

  1. お使いの GitHub Enterprise Server インスタンス で、Organization のメイン ページへ移動します。

  2. Organization 名の下で、 [設定] をクリックします。

    Organization の設定ボタン

  3. サイドバーの [セキュリティ] セクションで、 [シークレット] の順に選んだら、 [Dependabot] をクリックします。

  4. Click New organization secret.

  5. Type a name for your secret in the Name input box.

  6. Enter the Value for your secret.

  7. From the Repository access dropdown list, choose an access policy.

  8. If you chose Selected repositories:

    • Click .
    • In the dialog box, select the repositories that can access this secret.
    • Click Update selection.
  9. Click Add secret.

    The name of the secret is listed on the Dependabot secrets page. You can click Update to change the secret value or its access policy. You can click Remove to delete the secret.