我正在使用新的 GitHub 操作,下面的工作流程的想法是在打开或同步 pr 时运行,它应该首先检查并安装依赖项,然后运行一些 yarn 脚本
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
目前它成功进入结帐阶段,但是一旦运行安装作业,我就会收到以下错误
错误在“/home/runner/work/myRepo/myRepo”中找不到 package.json 文件
从这个结帐来看,要么失败,要么我在错误的文件夹中?