Files
webstudio/.github/workflows/chromatic.yml
Oleg Isonen f7bd67e533 chore: enable fork PR deployments via safe-to-deploy label (#5605)
## Description

1. What is this PR about (link the issue and add a short description)

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
0000)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2026-02-05 14:07:10 +01:00

53 lines
1.4 KiB
YAML

name: Chromatic
on:
push:
branches:
- main
pull_request:
pull_request_target:
types: [labeled]
# cancel in-progress runs on new commits to same PR (gitub.event.number)
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
chromatic:
# Run on push, regular PR (for repo branches), or labeled PR with safe-to-deploy (for forks)
if: |
github.event_name == 'push' ||
github.event_name == 'pull_request' ||
(github.event_name == 'pull_request_target' && github.event.label.name == 'safe-to-deploy')
timeout-minutes: 20
runs-on: ubuntu-latest
environment:
name: development
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2 # we need to fetch at least parent commit to satisfy Chromatic
ref: ${{ github.event.pull_request.head.sha || github.sha }} # HEAD commit instead of merge commit
# Storybook with submodules
- uses: ./.github/actions/submodules-checkout
with:
submodules-ssh-key: ${{ secrets.PRIVATE_GITHUB_DEPLOY_TOKEN }}
- uses: ./.github/actions/ci-setup
- name: Chromatic
id: chromatic
uses: chromaui/action@v11.3.0
with:
projectToken: bea8dc1981d4
buildScriptName: storybook:build