首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用github操作时色部署错误

使用github操作时色部署错误
EN

Stack Overflow用户
提问于 2021-04-23 22:14:53
回答 1查看 2.4K关注 0票数 0

我正在开发一个使用故事书的React项目,我试图用GitHub操作将这个故事书发布成彩色。为了满足我的项目需求,我使用了它们的示例chromatic.yml,只进行了几处更改。运行彩色cli,我的故事书就会被成功地解压,但是当我使用GitHub操作时,会显示以下错误:

代码语言:javascript
复制
Error: ✖ Failed to collect Storybook metadata
Could not find a supported Storybook viewlayer package. Make sure one is installed, or set CHROMATIC_STORYBOOK_VERSION.

以下是完整的错误日志:

代码语言:javascript
复制
Run chromaui/action@v1
  with:
    projectToken: ***

Chromatic CLI v5.7.0
https://www.chromatic.com/docs/cli

Authenticating with Chromatic
    → Connecting to https://index.chromatic.com
Authenticated with Chromatic
    → Using project token '********119f'
Retrieving git information
Retrieved git information
    → Commit 'a9f9af7' on branch 'master'; found 1 baseline commit
Collecting Storybook metadata
    → Could not find a supported Storybook viewlayer package. Make sure one is installed, or set CHROMATIC_STORYBOOK_VERSION.

✖ Failed to collect Storybook metadata
Could not find a supported Storybook viewlayer package. Make sure one is installed, or set CHROMATIC_STORYBOOK_VERSION.
→ View the full stacktrace below

If you need help, please chat with us at https://www.chromatic.com/docs/cli for the fastest response.
You can also email the team at support@chromatic.com if chat is not an option.

Please provide us with the above CLI output and the following info:
{
  "timestamp": "2021-04-23T22:03:58.789Z",
  "sessionId": "2f736280-50df-4f2e-aa3d-00d90236cf61",
  "gitVersion": "2.31.1",
  "nodePlatform": "linux",
  "nodeVersion": "12.13.1",
  "packageName": "chromatic",
Error: non-zero exit code
  "packageVersion": "5.7.0",
  "flags": {
    "projectToken": "***",
    "fromCI": true,
    "interactive": false,
    "exitZeroOnChanges": true,
    "exitOnceUploaded": false,
    "allowConsoleErrors": false
  },
  "buildScript": "build-storybook",
  "errorType": "Error",
  "errorMessage": "✖ Failed to collect Storybook metadata"
}

Error: ✖ Failed to collect Storybook metadata
Could not find a supported Storybook viewlayer package. Make sure one is installed, or set CHROMATIC_STORYBOOK_VERSION.
    at /home/runner/work/_actions/chromaui/action/v1/bin/lib/getStorybookInfo.js:83:11
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async getStorybookInfo (/home/runner/work/_actions/chromaui/action/v1/bin/lib/getStorybookInfo.js:115:25)
    at async setStorybookInfo (/home/runner/work/_actions/chromaui/action/v1/bin/tasks/storybookInfo.js:6:42)
    at async Task.task (/home/runner/work/_actions/chromaui/action/v1/bin/lib/tasks.js:13:7)

这是我的chromatic.yml

代码语言:javascript
复制
# Workflow name
name: "Chromatic Deployment"

# Event for the workflow
on:
  push:
    branches: [master, stagging, developing]
  pull_request:
    branches: [master, stagging, developing]
# List of jobs
jobs:
  test:
    # Operating System
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: foo
    # Job steps
    steps:
      - uses: actions/checkout@v1
      - run: yarn
        # Adds Chromatic as a step in the workflow
      - uses: chromaui/action@v1
        # Options required for Chromatic's GitHub Action
        with:
          # Chromatic projectToken, see https://storybook.js.org/tutorials/intro-to-storybook/react/en/deploy/ to obtain it
          projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-04-23 23:24:09

下面是我在色的官方存储库上发现的:

这个问题很有可能源自于我使用的是单粒子,我认为使用working-directory就足以解决这个问题,但是有一个可以使用chromaui,workinDir的增量参数。

这是我现在的chromatic.yml

代码语言:javascript
复制
# Workflow name
name: "Chromatic Deployment"

# Event for the workflow
on:
  push:
    branches: [master, stagging, developing]
  pull_request:
    branches: [master, stagging, developing]
# List of jobs
jobs:
  chromatic-deployment:
    # Operating System
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: foo
    # Job steps
    steps:
      - uses: actions/checkout@v1
      - run: yarn
        # Adds Chromatic as a step in the workflow
      - uses: chromaui/action@v1
        # Options required for Chromatic's GitHub Action
        with:
          workingDir: foo
          projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67237408

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档