Skip to content

Chromatic

Chromatic #4936

Workflow file for this run

name: Chromatic
on:
workflow_dispatch:
inputs:
number:
description: "Pull Request Number"
required: true
jobs:
check:
runs-on: ubuntu-latest
outputs:
branch_name: ${{ fromJson(steps.get_pull.outputs.data).head.label }}
steps:
- id: get_pull
uses: octokit/request-action@v2.x
with:
route: GET /repos/{owner}/{repo}/pulls/{pull_number}
owner: ${{ github.event.repository.owner.login }}
repo: ${{ github.event.repository.name }}
pull_number: ${{ github.event.inputs.number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- id: escape
name: Check for escape chars
run: |
if ${{ contains(fromJson(steps.get_pull.outputs.data).head.label, '"') }}
then
exit 1
else
exit 0
fi
chromatic:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: "refs/pull/${{ github.event.inputs.number }}/head"
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: ">=20.9.0 20"
- name: Install dependencies
run: npm ci
- name: Run chromatic on branch
run: npx chromatic@latest --project-token ${{ secrets.CHROMATIC_PROJECT_TOKEN }} --exit-once-uploaded --branch-name="${{ needs.check.outputs.branch_name }}" --only-changed true