chromaui/chromatic-cli

[Github action] Error: When triggering via workflow_dispatch, ref & sha are required inputs.

zigang93 opened this issue ยท 2 comments

Bug report

Screenshot 2023-02-07 at 4 08 40 PM

I am aware that I am using checkout@v3.. so I need to add fetch-depth: 0 from documentation..
I tried add ref: ${{ github.ref }} and sha: ${{ github.sha }}, still failed

this link is unavailable.. https://github.com/chromaui/action#triggering-from-workflow
my action yml file:

# Workflow name
name: 'Chromatic - Storybook deploy'

# Event for the workflow
on:
  workflow_dispatch:

# List of jobs
jobs:
  chromatic-deployment:
    # Operating System
    runs-on: ubuntu-latest
    # Job steps
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
          ref: ${{ github.ref }}
          sha: ${{ github.sha }}

      - uses: pnpm/action-setup@v2.0.1
        name: Install pnpm
        id: pnpm-install
        with:
          version: 7
          run_install: false

      - name: Get pnpm store directory
        id: pnpm-cache
        run: |
          echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"

      - uses: actions/cache@v3
        name: Setup pnpm cache
        with:
          path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
          key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
          restore-keys: |
            ${{ runner.os }}-pnpm-store-

      - name: Install dependencies
        run: pnpm install --frozen-lockfile

        # ๐Ÿ‘‡ Adds Chromatic as a step in the workflow
      - name: Publish to Chromatic
        uses: chromaui/action@v1
        # Chromatic GitHub Action options
        with:
          # ๐Ÿ‘‡ Chromatic projectToken, refer to the manage page to obtain it.
          projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}

Hi @zigang93! Can you try using the chromaui/action-next@v1 version of the Github Action? We recently added a fix that should resolve this.

Hi @zigang93! We've released a new version of the GitHub Action that resolves this issue with workflow_dispatch. Let us know if you run into any issues.