管道操作已弃用(Node.js 12)

a8jjtwal  于 2023-06-22  发布在  Node.js
关注(0)|答案(1)|浏览(154)

我目前正在为Github上的一个项目设置一个简单的CI管道,但我遇到了一个问题。当我运行Selene Lint检查时,我的代码确实成功集成,但我得到以下警告:
Node.js 12个动作被弃用。有关详细信息,请参阅:https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/
请更新以下操作以使用Node.js 16:Roblox/setup-foreman@v1
下面是我的ci.yaml

name: CI Pipeline

on:
  push:
    branches:
    - main
  pull_request:
    branches:
    - main

jobs: 

  lint:
    name: Selene Lint
    runs-on: ubuntu-latest
    steps: 
    - name: Checkout code
      uses: actions/checkout@v3

    - uses: Roblox/setup-foreman@v1
      name: Install Foreman
      with: 
        version: "^1.0.0"
        token: ${{ SECRETS.GITHUB_TOKEN }}

    - name: Selene Lint
      run: |
        selene ./src

有人知道如何使用Node.js 16设置Foreman吗?
不幸的是,这是我第一次设置CI管道,所以我不熟悉如何处理这个问题。

j91ykkif

j91ykkif1#

看看2023年6月是否仍然如此:Roblox/setup-foreman PR 39在4月更新了Node版本。2023年的v2.1 release
他们的action.yml现在包含正确的版本:

name: 'Setup Foreman'
description: 'Install Foreman, a toolchain manager for Roblox projects'
author: 'The Rojo Developers'
inputs:
  version:
    required: false
    description: 'SemVer version of Foreman to install'
  working-directory:
    required: false
    description: 'Working directory to run `foreman install` in'
  token:
    required: true
    description: 'GitHub token from secrets.GITHUB_TOKEN'
runs:
  using: 'node16'
  main: 'dist/index.js'

相关问题