如何在GitHub操作中运行特定文件夹中的配置项步骤 [英] How do I run my CI steps in a specific folder in github action

查看:11
本文介绍了如何在GitHub操作中运行特定文件夹中的配置项步骤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我与react客户端有golang回购。我想使用GitHub操作为我的客户设置配置项。Reaction客户端位于工作区的client文件夹中。 我编写了以下工作流

name : Node.js CI

on: [push, pull_request]

jobs:

  build:
    name: build
    runs-on: ubuntu-latest
    steps:

    - uses: actions/checkout@v2 
      with:
        path: client
    - name: Set up Node.js
      uses: actions/setup-node@v1
      with:
        node-version: 12.x

    - run: yarn install

    - run: yarn build

但在提交时显示以下错误

 Run yarn build1s
##[error]Process completed with exit code 1.
Run yarn build
yarn run v1.21.1
error Couldn't find a package.json file in "/home/runner/work/evential/evential"
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
##[error]Process completed with exit code 1

代码段

- uses: actions/checkout@v2 
      with:
        path: client
不会使以下步骤在client文件夹内运行。

需要帮助。提前谢谢。

推荐答案

您可以在run步骤中使用working-directory关键字。请参阅文档here

    - run: yarn install
      working-directory: client

    - run: yarn build
      working-directory: client

这篇关于如何在GitHub操作中运行特定文件夹中的配置项步骤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆