chromatic-cli icon indicating copy to clipboard operation
chromatic-cli copied to clipboard

Chromatic Action bug: `skip` doesn't always mark "UI Review" as skipped

Open amhunt opened this issue 2 years ago • 1 comments

Bug report

We are using skip in Chromatic's GH action. It works sometimes, but other times, it fails to mark "UI Review" as "skipped". Interestingly, "UI Test" does always seem to be marked as "Skipped".

Chromatic build output

Screen Shot 2022-09-13 at 9 38 25 PM

CI Checks (2 different screenshots, but from the same build)

Screen Shot 2022-09-13 at 9 37 57 PM Screen Shot 2022-09-13 at 9 38 14 PM

Please let me know if there are any known fixes, or if you need more info from me :)

amhunt avatar Sep 14 '22 04:09 amhunt

Hi @amhunt,

It is a little trickier for Chromatic to skip that check because it needs to match your CI build to a PR. Sometimes it has trouble if the branch or slug name reported from the CI is not correct. I've replied to you in intercom with the values we had for this skipped build-- but for others seeing this problem that is probably the place to start.

tmeasday avatar Sep 15 '22 02:09 tmeasday

Chromatic support point me to this issue. For anyone wondering, this is how to pass the env vars to it:

name: Chromatic

on:
  pull_request:
    types: [opened, synchronize, labeled, unlabeled]
    branches:
      - main

jobs:
  chromatic-deployment:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v2
        with:
          fetch-depth: 0 # Fetch the full Git history

      - name: Install dependencies
        run: npm install

      - name: Publish to Chromatic
        uses: chromaui/action@v1
        with:
          projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
          skip: ${{ !contains(github.event.pull_request.labels.*.name, 'requires-ux-review') }}
        env:
          CHROMATIC_SHA: ${{ github.event.pull_request.head.sha }}
          CHROMATIC_BRANCH: ${{ github.head_ref }}
          CHROMATIC_SLUG: 'gitub/github'

sam3k avatar Sep 27 '23 20:09 sam3k