每一步都必须定义一个 `uses` 或 `运行` 键

every step must define a `uses` or `run` key

我正在 Github 操作上开发管道并在第 32 行返回错误,这是 - run: | every step must define a uses or run key 的行,我的目标是 运行管道中的 cypress 自动化测试。让我给你看代码

name: Nuxt CI Pipeline
on:
  push:
    branches: [ Cypress-reconfigure ]
  # pull_request:
  #   branches: [ master ]

jobs:
  build:

    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [ 14.x ]
        # See supported Node.js release schedule at https://nodejs.org/en/about/releases/

    steps:
    - uses: actions/checkout@v2
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v2
      with:
        node-version: ${{ matrix.node-version }}
        cache: 'npm'
    - name: Generating .env files
      env:
        STAGING_ENV_FILE: ${{ secrets.STAGING_ENV_FILE }}
        PRODUCTION_ENV_FILE: ${{ secrets.PROD_ENV_FILE }}
    - run: |
        [ "$GITHUB_REF_NAME" = Cypress-reconfigure ] && echo $STAGING_ENV_FILE | base64 --decode > .env
        [ "$GITHUB_REF_NAME" = staging ] && echo $PRODUCTION_ENV_FILE | base64 --decode > .env
    - run: cat .env 
    - run: npm ci
    - run: npm run cy:ci

我认为我对 运行 命令做错了什么,我对 devops 的了解有限。谁能指出我正确的方向?

将要命名的 运行 前面的 - 去掉。

    - name: Generating .env files
      env:
        STAGING_ENV_FILE: ${{ secrets.STAGING_ENV_FILE }}
        PRODUCTION_ENV_FILE: ${{ secrets.PROD_ENV_FILE }}
      run: |
        [ "$GITHUB_REF_NAME" = Cypress-reconfigure ] && echo $STAGING_ENV_FILE | base64 --decode > .env
        [ "$GITHUB_REF_NAME" = staging ] && echo $PRODUCTION_ENV_FILE | base64 --decode > .env