高木のブログ

【GitHub Actions】「Node.js 12 actions are deprecated.」の対応

2022/11/13

とある Ruby のプロジェクトの GitHub Actions のページを開いたら、以下の警告が出ていた

Node.js 12 actions are deprecated. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/. Please update the following actions to use Node.js 16: actions/checkout, actions/checkout

GitHub Actions で Node.js 12 のサポートが終了するから Node.js 16 に切り替えろとのこと
Ruby のプロジェクトだけど、actions/checkout で Node.js を使っているため対応する必要がある

対応方法

actions/[email protected] から actions/[email protected] に変更するだけで良い

     name: Ruby ${{ matrix.ruby }}
     steps:
-    - uses: actions/[email protected]
+    - uses: actions/[email protected]
     - name: Set up Ruby
       uses: ruby/[email protected]

Dependabot で GitHub Actions のアクションを自動更新する

手動で対応するのは面倒なので、ライブラリなどと同じようにアクションも Dependabot で更新するようにした

dependabot.yml
- package-ecosystem: "github-actions"
  directory: "/"
  schedule:
    interval: "daily"

SNS でシェアする


ytkg

Written by ytkg, Twitter, GitHub