[Github action] Error: When triggering via workflow_dispatch, ref & sha are required inputs.
zigang93 opened this issue ยท 2 comments
zigang93 commented
Bug report
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 }}