新的GitHub操作在空文件夹中运行

问题描述:

我正在使用新的GitHub动作,以下工作流程的想法是在打开或同步pr时运行,它应该首先签出并安装依赖项,然后再运行少量的yarn脚本

I am working with new GitHub actions, idea of a workflow below is to run when pr is opened or synchronised, it should first check out and install dependencies and afterwards run few yarn scripts

name: PR to Master
on: 
  pull_request:
    branches:
    - master
jobs:
  # Synchronize or Opened
  synchronized_or_opened:
    name: Synchronize or Opened
    runs-on: ubuntu-latest
    steps:
    - uses: actions/bin/filter@master
      with:
        args: action 'opened|synchronize'
  # Add Labels
  add_labels:
    name: Add Labels
    runs-on: ubuntu-latest
    steps:
    - uses: actions/labeler@v2
      with:
        repo-token: ${{ secrets.GITHUB_TOKEN }}
    needs: synchronized_or_opened
  # Checkout
  checkout:
    name: Checkout
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    needs: synchronized_or_opened
  # Install Dependencies
  install_dependencies:
    name: Install Dependencies
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [10.x]
    steps:
    - run: yarn dep:install-npm
    needs: checkout
  # Typecheck
  typecheck:
    name: Typecheck
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [10.x]
    steps:
    - run: yarn typecheck
    needs: install_dependencies
  # Prettier
  prettier:
    name: Prettier
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [10.x]
    steps:
    - run: yarn prettier
    needs: install_dependencies
  # ESLint
  eslint:
    name: ESlint
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [10.x]
    steps:
    - run: yarn eslint
    needs: install_dependencies
  # Danger
  danger:
    name: Danger
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [10.x]
    steps:
    - run: yarn danger
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    needs: install_dependencies

目前它已成功进入结帐阶段,但是一旦安装作业运行,我将收到以下错误消息

At the moment it successfully gets to a checkout stage, but once Install job is ran I get following error

错误无法在以下位置找到package.json文件 "/home/runner/work/myRepo/myRepo"

error Couldn't find a package.json file in "/home/runner/work/myRepo/myRepo"

通过此结帐判断失败还是我在错误的文件夹中?

Judging by this checkout either failed or I am in a wrong folder?