【Github】Github Actions ~ deprecationによるエラー防止を考える ~

◾️はじめに

https://dk521123.hatenablog.com/entry/2024/07/05/000212

の時もそうだったが、突然、Github actionsのWorkflowでエラーになった。
まずは、そのエラーに関する説明と、今後の防止案について考えてみた。

目次

【1】今回のトラブル:エラー「...because it uses a deprecated version of actions/upload-artifact: v3」
 1)エラー内容
 2)原因
 3)解決案
【2】今後の防止案
 1)github.blogを定期的に監視する
 2)Github actionsの警告文を無視せずにみる
【3】Github Actionsに関する個人的な結論(ぼやき)

【1】今回のトラブル:エラー「...because it uses a deprecated version of actions/upload-artifact: v3」

GitHub Actions で以下「1)エラー内容」が発生した

1)エラー内容

This request has been automatically failed
 because it uses a deprecated version of actions/upload-artifact: v3.
Learn more: https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/

意訳:
このリクエストは自動的に失敗します
なぜなら、非推奨バージョンであるactions/upload-artifact: v3を使っているからです。
より詳細は、https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/
をご覧ください

2)原因

エラー内容や

https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/
https://github.com/actions/upload-artifact

に記載されている通りで、
actions/upload-artifact(actions/download-artifactも)の v3 を使用しているため

# 頼むから、こんな強引な方法で、システム止めるのは、やめてくれ、、、

3)解決案

https://github.com/actions/upload-artifact

より抜粋
~~~~~~~
Please update your workflow to use v4 of the artifact actions. 

意訳:
対象 artifact actionsのv4 を使うようにあなたのWorkflowを更新してください
~~~~~~~
 => それでもエラーになったら、「actions/upload-artifact」の使用を諦めて
  独自で実装する(s3へのアップロードなら、aws s3 cp とかで実装)

【2】今後の防止案

1)github.blogを定期的に監視する

https://github.blog/changelog/label/actions/

の記事やRSSやTwitterを定期的に監視する
〜〜〜〜
Subscribe to all “Actions” posts via RSS
 or follow GitHub Changelog on Twitter to stay updated on everything we ship
〜〜〜〜

できれば、キーワード「deprecation」「deprecate」って文字があったら
Slackで通知するのが、ベターか、、、

2)Github actionsの警告文を無視せずにみる

Annotation に Warning で出てくることが多いので、
気づいたら、検索する(いつ止めるかも把握できるといいが、、、)

 以下のサイトでやっている
「GitHub Actionsでdeprecation warningが発生しているworkflowを簡単に調べる」
ってのもいいかも、、、

https://horimisli.me/entry/list-workflows-with-warning/

【3】Github Actionsに関する個人的な結論(ぼやき)

 防止案を考えてみたが、個人的な意見としては、
日本の銀行・証券などのより厳しいところでは
GitHub Actions は使えないな、、、という結論。。。

 特に、今回は、以下の関連記事にあるように
公式ドキュメントでセキュリティのために、
Commit hash化してVersion指定しても
こんな感じで無理やり止められたら、結局使っている方(そのシステムを使っている顧客含む)
としては、バグでしかないので、本当にやめてほしい、、、

Github Actions ~ セキュリティ/Third-Party Github Action ~
https://dk521123.hatenablog.com/entry/2024/04/05/000136

関連記事

Github ~ 入門編 ~
https://dk521123.hatenablog.com/entry/2019/07/18/234652
Github Actions ~ 基礎知識編 ~
https://dk521123.hatenablog.com/entry/2021/11/04/142835
Github Actions ~ 入門編 ~
https://dk521123.hatenablog.com/entry/2022/06/16/151443
Github Actions ~ 基本編 ~
https://dk521123.hatenablog.com/entry/2023/12/22/195715
Github Actions ~ GITHUB_TOKEN / permissions ~
https://dk521123.hatenablog.com/entry/2024/04/22/221027
Github Actions ~ Self-hosted runners / 入門編 ~
https://dk521123.hatenablog.com/entry/2023/12/18/204119
Github Actions ~ Self-hosted runners / あれこれ編 ~
https://dk521123.hatenablog.com/entry/2024/02/07/002736
Github Actions ~ セキュリティ/Third-Party Github Action ~
https://dk521123.hatenablog.com/entry/2024/04/05/000136
Github Actions ~ セキュリティ/インジェクション攻撃 ~
https://dk521123.hatenablog.com/entry/2024/04/16/222419
Github Actions ~ 別レポジトリをcloneするには ~
https://dk521123.hatenablog.com/entry/2025/02/02/161957
Self-hosted runner下の Github actions が突然エラー
https://dk521123.hatenablog.com/entry/2024/07/05/000212