Run chromatic on main after PR is merged with proper label (#3909)
This commit is contained in:
parent
6cc8f78746
commit
c99fa1c5a0
2 changed files with 22 additions and 3 deletions
5
.changeset/clever-pandas-crash.md
Normal file
5
.changeset/clever-pandas-crash.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"saleor-dashboard": patch
|
||||
---
|
||||
|
||||
Run chromatic on main after PR is merged
|
20
.github/workflows/storybook-chromatic-main.yml
vendored
20
.github/workflows/storybook-chromatic-main.yml
vendored
|
@ -1,13 +1,28 @@
|
|||
name: QA
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
branches:
|
||||
- "main"
|
||||
- main
|
||||
types: [closed]
|
||||
|
||||
jobs:
|
||||
if_merged:
|
||||
permissions:
|
||||
pull-requests: read
|
||||
if: github.event.pull_request.merged == true
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
labels: ${{ steps.get_labels.outputs.labels }}
|
||||
steps:
|
||||
- name: Get PR labels
|
||||
id: get_labels
|
||||
uses: joerick/pr-labels-action@7beda983e70efd41dd55ef246d0b3bba82820f4c # v1.0.8
|
||||
|
||||
chromatic-storybook-main:
|
||||
runs-on: ubuntu-latest
|
||||
needs: if_merged
|
||||
if: ${{ contains(needs.if_merged.outputs.labels, ' run chromatic ') }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
|
@ -33,7 +48,6 @@ jobs:
|
|||
run: npm ci
|
||||
|
||||
- name: Publish to Chromatic and auto accept changes
|
||||
if: github.ref == 'refs/heads/main'
|
||||
uses: chromaui/action@a89b674adf766dbde41ad9ea2b2b60b91188a0f0 # v6.17.4
|
||||
with:
|
||||
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
|
||||
|
|
Loading…
Reference in a new issue