2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

dependabotとは

Dependabot を使って、プロジェクトで使用される依存関係の脆弱性を監視し、依存関係を最新の状態に保ちます。
https://docs.github.com/ja/code-security/dependabot

です。
言語に応じたパッケージを監視して、いい感じに最新の状態にしてくれます(PRを作ってくれます)。

↓ GitHubの内部でも使われているみたいです。

使ってみる

  1. 特定のリポジトリからSettingsを開きます。
  2. Code security and analysisを開き、Dependabot alertsDependabot security updatesを有効化します。
  3. どのパッケージを監視するのかを.github/dependabot.ymlに記述します。
  4. mainブランチにpushしたら完了です。
  • .github/dependabot.ymlの例
    • package-ecosystem
      • パッケージマネージャーを指定します(この例ではgemの管理をするので、bundlerを指定しています)。
    • directory
      • パッケージマネージャーが探すマニフェストファイルの位置を指定します。
      • npmならpackage.json、bundlerならGemfileなどの位置です。
    • schedule.interval
      • どれくらいの頻度で、新しいバージョンを確認するかを指定します。
      • この例では1日に1回の頻度で確認するように指定しています。
    • 他の設定もあるので、詳しくはこちら!
.github/dependabot.yml
  version: 2
  updates:

    - package-ecosystem: "bundler"
      directory: "/"
      schedule:
        interval: "daily"

mainブランチにpushして更新できるものがあれば、以下のようにPRが作られます。
めちゃくちゃ便利!!

スクリーンショット 2023-07-19 0.07.19.png

参考

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?