<commit_before>name: Design System visual testing

on:
  workflow_dispatch:
    inputs:
      sha:
        description: The SHA-1 hash referring to the commit to check.
        required: true
      ref:
        description: The head branch associated with the pull request.
        required: true
  pull_request:
    branches:
      - master
    types:
      - labeled
  push:
    branches:
      - master
    paths:
      - "packages/design-tokens/**"
      - "packages/design-system/**"

jobs:
  build:
    runs-on: ubuntu-latest
    if: |
      (github.ref == 'refs/heads/master') ||
      contains(github.event.pull_request.labels.*.name, 'need visual approval'))
    environment: pull_request_unsafe
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - uses: actions/setup-node@v3
        with:
          node-version: 16
          registry-url: "https://registry.npmjs.org/"
          scope: "@talend"
          cache: "yarn"

      - name: Install dependencies
        run: yarn --frozen-lock --ignore-scripts

      - name: Build @talend/design-tokens
        run: |
          yarn workspace @talend/design-tokens run build:lib

      - name: Publish PR to DS Chromatic
        if: github.ref != 'refs/heads/master'
        uses: chromaui/action@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
          workingDir: "packages/design-system"
          exitZeroOnChanges: true # Option to prevent the workflow from failing in PR

      - name: Publish Master to DS Chromatic
        if: github.ref == 'refs/heads/master'
        uses: chromaui/action@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
          workingDir: "packages/design-system"
          autoAcceptChanges: true # Option to accept any change for this baseline refresh
<commit_msg>chore(ci): Trigger visual NR on push (#3891)<commit_after>name: Design System visual testing

on:
  workflow_dispatch:
    inputs:
      sha:
        description: The SHA-1 hash referring to the commit to check.
        required: true
      ref:
        description: The head branch associated with the pull request.
        required: true
  pull_request:
    # By default, a workflow only runs when a pull_request event's activity type is opened, synchronize, or reopened
    types: [ labeled, synchronize, opened, reopened]
    branches:
      - master
  push:
    branches:
      - master
    paths:
      - "packages/design-tokens/**"
      - "packages/design-system/**"

jobs:
  build:
    runs-on: ubuntu-latest
    if: |
      (github.ref == 'refs/heads/master') ||
      contains(github.event.pull_request.labels.*.name, 'need visual approval'))
    environment: pull_request_unsafe
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - uses: actions/setup-node@v3
        with:
          node-version: 16
          registry-url: "https://registry.npmjs.org/"
          scope: "@talend"
          cache: "yarn"

      - name: Install dependencies
        run: yarn --frozen-lock --ignore-scripts

      - name: Build @talend/design-tokens
        run: |
          yarn workspace @talend/design-tokens run build:lib

      - name: Publish PR to DS Chromatic
        if: github.ref != 'refs/heads/master'
        uses: chromaui/action@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
          workingDir: "packages/design-system"
          exitZeroOnChanges: true # Option to prevent the workflow from failing in PR

      - name: Publish Master to DS Chromatic
        if: github.ref == 'refs/heads/master'
        uses: chromaui/action@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
          workingDir: "packages/design-system"
          autoAcceptChanges: true # Option to accept any change for this baseline refresh

{'fraction_non_alphanumeric': 0.09950859950859951, 'fraction_numerical': 0.004914004914004914, 'mean_word_length': 2.1436293436293434, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6447', 'n_tokens_mistral': 1208, 'n_tokens_neox': 1160, 'n_words': 322}