Skip to content

Commit

Permalink
ci: change chromatic build ci condition (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
smithoo authored Feb 7, 2025
1 parent 139564f commit 13dd752
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,12 @@
name: Chromatic

on:
pull_request:
types: [opened, synchronize]
push:
branches:
- main
pull_request_review:
types: [submitted]

jobs:
check-commit-message:
runs-on: ubuntu-latest
outputs:
message: ${{ steps.get_commit_message.outputs.message }}
steps:
- name: Get repo
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Get commit message
id: get_commit_message
run: echo "message=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"

chromatic-build:
needs: check-commit-message
if: ${{ github.event.action != 'synchronize' || contains(needs.check-commit-message.outputs.message, 'chromatic-build') }}
if: ${{ github.event.pull_request.base.ref == 'main' && github.event.review.state == 'approved' }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down

0 comments on commit 13dd752

Please sign in to comment.