@@ -3,14 +3,19 @@ name: VRT Triggered from Label
33on :
44 pull_request :
55 types : [labeled]
6+ push :
7+ branches : ["2[0-9][02468]-*-2[0-9]"]
68
79env :
810 CHROMATIC_PROJECT_TOKEN : ${{ secrets.CHROMATIC_PROJECT_TOKEN_DSE }}
911
1012jobs :
1113 vrt-storybook-prepare :
12- if : startsWith(github.event.label.name, 'vrt:')
14+ if : |
15+ startsWith(github.event.label.name, 'vrt:') || github.event_name == 'push'
1316 runs-on : salesforce-ux-emu-Ubuntu
17+ outputs :
18+ auto-accept-changes : ${{ steps.check-auto-accept-status.outputs.result }}
1419 steps :
1520 - uses : actions/checkout@v3
1621
4247 name : storybook-build-for-chromatic
4348 path : workspace/storybook.tar.gz
4449
50+ - name : Check if chromatic baselines should be auto-accepted
51+ id : check-auto-accept-status
52+ uses : ./.github/actions/baseline-auto-accept-checks
53+ with :
54+ auto-accept-branches : ${{ vars.AUTO_BASELINE_ACCEPT_BRANCHES }}
55+
4556 vrt-chromatic :
4657 # if: ${{ (1 < 0) }}
4758 runs-on : salesforce-ux-emu-Ubuntu
@@ -69,20 +80,20 @@ jobs:
6980 working-directory : workspace
7081 run : tar -xvf storybook.tar.gz
7182
72- - name : Publish dse-system-internal to chromatic
83+ - name : Publish dse-system-internal to chromatic # turbo snapshots disabled
7384 id : chromatic
7485 uses : chromaui/action@v10
7586 with :
7687 projectToken : ${{ secrets.CHROMATIC_PROJECT_TOKEN_DSE }}
7788 storybookBuildDir : workspace/.www
7889 exitZeroOnChanges : true
7990 exitOnceUploaded : true
80- onlyChanged : true
81- traceChanged : true
91+ autoAcceptChanges : ${{ needs.vrt-storybook-prepare.outputs.auto-accept-changes }}
8292
8393 - name : Find Chromatic Comment
8494 uses :
salesforce-ux-emu/[email protected] 8595 id : find-chromatic-comment
96+ if : needs.vrt-storybook-prepare.outputs.auto-accept-changes == 'false'
8697 with :
8798 issue-number : ${{ github.event.pull_request.number }}
8899 comment-author : " github-actions[bot]"
91102 - name : Publish Chromatic results to GitHub
92103 uses :
salesforce-ux-emu/[email protected] 93104 id : post-chromatic-comment
105+ if : needs.vrt-storybook-prepare.outputs.auto-accept-changes == 'false'
94106 with :
95107 comment-id : ${{ steps.find-chromatic-comment.outputs.comment-id }}
96108 issue-number : ${{ github.event.pull_request.number }}
0 commit comments