当前位置:   article > 正文

【github action】workflow突然down掉,报错Node.js 16 actions are deprecated. Please update the

node.js 16 actions are deprecated. please update the following actions to us

github action之前正常运行,现在commit内容的时候,无法运行

一、调试过程

使用actions中的re-run jobs,并启用调试功能,运行faild jobs,然后可以看到如下输出报错内容:

Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20
  • 1

building中运行的内容出错

Start building sites … 
hugo v0.123.3-a75a659f6fc0cb3a52b2b2ba666a81f79a459376+extended linux/amd64 BuildDate=2024-02-23T17:09:20Z VendorInfo=gohugoio

ERROR render of "section" failed: "/tmp/hugo_cache_runner/modules/filecache/modules/pkg/mod/github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy/v5@v5.8.1-0.20230812165002-59b648791d3f/layouts/_default/baseof.html:11:403": execute of template failed: template: book/list.html:11:403: executing "book/list.html" at <.File.UniqueID>: can't evaluate field File in type *source.File
  • 1
  • 2
  • 3
  • 4

二、解决办法

根据第二个链接内容提示,猜测actions/checkout@v4这个版本可能有问题,然后将v3修改成v4,重新commit,依然报错。再观察报错内容,发现运行hugo v0.123.3-之后出现错误,猜测可能是hugo版本升级,导致有些内容不匹配。

接着修改hugo的版本:

hugo-version: "latest"
修改为:
hugo-version: '0.119.0'
  • 1
  • 2
  • 3

修改后,重新commit,action正常工作,但是还是会有一个warning

1 warning
hugo-auto-deploy
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, peaceiris/actions-hugo@v2, peaceiris/actions-gh-pages@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
  • 1
  • 2
  • 3

查看warning对应内容,可以看到如下说明:

Node 16 has reached its end of life, prompting us to initiate its deprecation process for GitHub Actions. Our plan is to transition all actions to run on Node 20 by Spring 2024. We will actively monitor the migration's progress and gather community feedback before finalizing the transition date. **Starting October 23rd, workflows containing actions running on Node 16 will display a warning to alert users about the upcoming migration.**
  • 1

说明actions/checkout@v3, peaceiris/actions-hugo@v2, peaceiris/actions-gh-pages@v3.这些版本需要更新和升级了。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/697437
推荐阅读
相关标签
  

闽ICP备14008679号