0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

GitHub ActionsでChromaticをデプロイした際に発生したエラーの対処法

Last updated at Posted at 2023-01-22

やりたいこと

Automate Chromatic with GitHub Actions • Chromatic docs
こちらの公式ドキュメントを参考にして、プルリクエスト作成時にChromaticをデプロイを行うワークフローを作成します。

ディレクトリ構成
.
├── .github
│   └── workflows
├── app
│   ├── node_modules
│   ├── package-lock.json
│   ├── package.json
│   └── src
├── compose.yml
└── docker
    └── next
.github/workflows/chromatic.yml
name: Deploy Chromatic

on:
  pull_request:
    branches:
      - develop
    types:
      - opened
      - synchronize

jobs:
  chromatic-deployment:
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: app
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Install dependencies
        run: npm ci

      - name: Publish to Chromatic
        uses: chromaui/action@v1
        with:
          projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}

エラー内容

Error: The "path" argument must be of type string or an instance of Buffer or URL. Received null

解決策

公式ドキュメントのモノレポ構成でのサンプルのように、workingDirを指定することで動作しました。
Automate Chromatic with GitHub Actions • Chromatic docs

.github/workflows/chromatic.yml
      - name: Publish to Chromatic
        uses: chromaui/action@v1
        with:
          projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
+         workingDir: app

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?