File tree Expand file tree Collapse file tree 2 files changed +24
-32
lines changed
Expand file tree Collapse file tree 2 files changed +24
-32
lines changed Original file line number Diff line number Diff line change 1010 build :
1111 runs-on : ubuntu-latest
1212
13+ env :
14+ CHROMATIC_BRANCH : ${{ github.event.pull_request.head.ref || github.ref_name }}
15+ CHROMATIC_SHA : ${{ github.event.pull_request.head.sha || github.ref }}
16+ CHROMATIC_SLUG : ${{ github.repository }}
17+ CHROMATIC_PROJECT_TOKEN : ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
18+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
19+
1320 steps :
1421 - name : Checkout
1522 uses : actions/checkout@v5
3744
3845 - name : Storybook build
3946 run : yarn build-storybook
47+
48+ - name : Switch to PR branch SHA
49+ if : ${{ github.event_name == 'pull_request' && env.CHROMATIC_PROJECT_TOKEN }}
50+ uses : actions/checkout@v5
51+ with :
52+ clean : false
53+ fetch-depth : 0
54+ ref : ${{ env.CHROMATIC_BRANCH }}
55+
56+ - name : Storybook deploy
57+ uses : chromaui/action@v13
58+ with :
59+ autoAcceptChanges : main
60+ branchName : ${{ env.CHROMATIC_BRANCH}}
61+ onlyChanged : ${{ github.event_name == 'pull_request' }}
62+ projectToken : ${{ env.CHROMATIC_PROJECT_TOKEN }}
63+ token : ${{ env.GITHUB_TOKEN }}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments