Skip to content

introduce new visual regression tests with chromatic instead of storybook #1

introduce new visual regression tests with chromatic instead of storybook

introduce new visual regression tests with chromatic instead of storybook #1

Workflow file for this run

name: comment image under PR
on:
pull_request:
types: [opened, synchronize]
jobs:
generate-image:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Generate an image (example)
run: |
convert -size 100x100 xc:blue image.png
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: pr-image
path: image.png
comment-with-image:
needs: generate-image
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: pr-image
path: .
- name: Upload image to GitHub Issue
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
IMG_URL=$(gh api \
--method POST \
-H "Accept: application/vnd.github.v3+json" \
-F "[email protected]" \
/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments)
COMMENT_URL=$(echo $IMG_URL | jq -r .url)
gh api --method POST /repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
-f body="Here is the generated image: ![Artifact Image]($COMMENT_URL)"