Skip to content

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

introduce new visual regression tests with chromatic instead of storybook

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

Workflow file for this run

name: PR Image Comment
on:
pull_request:
types: [opened, synchronize]
jobs:
generate-image:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install ImageMagick
run: sudo apt-get update && sudo apt-get install -y imagemagick
- name: Generate an image (example)
run: |
convert -size 100x100 xc:blue image.png # Creates a 100x100 blue image
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: pr-image
path: image.png
comment-with-link:
needs: generate-image
runs-on: ubuntu-latest
steps:
- name: Post comment with artifact link
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ARTIFACT_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
COMMENT_BODY="The generated image is available as an artifact. You can download it [here]($ARTIFACT_URL)."
gh api --method POST /repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
-f body="$COMMENT_BODY"