Skip to main content

Dependabot on GitHub Actions

Detailed information on using Dependabot with GitHub Actions.

Restrictions when Dependabot triggers events

Dependabot は、pull request とコメントで GitHub Actions ワークフローをトリガーできます。ただし、特定のイベントは異なる方法で処理されます。

For workflows initiated by Dependabot (github.actor == 'dependabot[bot]') using the pull_request, pull_request_review, pull_request_review_comment, push, create, deployment, and deployment_status events, these restrictions apply:

  • GITHUB_TOKEN has read-only permissions by default.
  • Secrets are populated from Dependabot secrets. GitHub Actions secrets are not available.

For workflows initiated by Dependabot (github.actor == 'dependabot[bot]') using the pull_request_target event, if the base ref of the pull request was created by Dependabot (github.event.pull_request.user.login == 'dependabot[bot]'), the GITHUB_TOKEN will be read-only and secrets are not available.

These restrictions apply even if the workflow is re-run by a different actor.

For more information, see Keeping your GitHub Actions and workflows secure: Preventing pwn requests.

Requirements for using Dependabot with self-hosted runners

To generate Dependabot updates using self-hosted runners, you need to properly configure your system, network, and certificates.

System requirements

Dependabot ランナーのために使用する 仮想マシン (VM) は、セルフホステッド ランナーの要件を満たす必要があります。 さらに、次の要件も満たしている必要があります。

  • Linux オペレーティング システム

  • x64 アーキテクチャ

  • Docker がランナー ユーザーのアクセス権を使用してインストールされていること:

    • Docker をルートレス モードでインストールし、root 権限なしで Docker にアクセスするようにランナーを構成することをお勧めします。
    • または、Docker をインストールしてから、Docker を実行するための昇格権限をランナー ユーザーに付与します。

CPU とメモリの要件は、特定の VM にデプロイする同時実行ランナーの数によって異なります。 ガイダンスとしては、1 台の 2 CPU 8 GB マシンに 20 台のランナーを正常に設定できました。ただし、最終的に CPU とメモリの要件は更新対象のリポジトリによって大きく異なります。 エコシステムによっては、他のエコシステムよりも多くのリソースが必要になります。

14 を超える同時実行ランナーを 1 つの VM に指定する場合は、Docker が作成できるネットワークの既定数を増やすように Docker の /etc/docker/daemon.json 構成も更新する必要があります。

{
  "default-address-pools": [
    {"base":"10.10.0.0/16","size":24}
  ]
}

Network requirements

Dependabot ランナーは、パブリック インターネット、GitHub.com、および Dependabot updates 更新プログラムで使用されるすべての内部レジストリへのアクセスが必要です。 内部ネットワークに対するリスクを最小限に抑えるには、仮想マシン (VM) から内部ネットワークへのアクセスを制限する必要があります。 これにより、ハイジャックされた依存関係をランナーがダウンロードした場合に、内部システムが損害を受ける可能性が減少します。

Certificate configuration

If Dependabot needs to interact with registries that use self-signed certificates, those certificates must also be installed on the self-hosted runners that run Dependabot jobs. This security hardens the connection. You must also configure Node.js to use the certificate, because most actions are written in JavaScript and run using Node.js, which does not use the operating system certificate store.