Skip to content

Commit a402d28

Browse files
committed
Ignore Chromatic if missing secret
1 parent e1a6fe3 commit a402d28

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/compile.js.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ concurrency:
1414
jobs:
1515
build:
1616
runs-on: ubuntu-latest
17+
env:
18+
HAVE_CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN != '' }}
1719
strategy:
1820
matrix:
1921
node: [ '20' ]
@@ -131,14 +133,18 @@ jobs:
131133
npm run build-storybook
132134
133135
- name: Publish to Chromatic
134-
if: ${{ github.actor != 'dependabot[bot]' }}
136+
if: ${{ github.actor != 'dependabot[bot]' && env.HAVE_CHROMATIC_PROJECT_TOKEN == 'true' }}
135137
uses: chromaui/action@latest
136138
# Options required to the GitHub Chromatic Action
137139
with:
138140
# 👇 Chromatic projectToken, refer to the manage page to obtain it.
139141
token: ${{ secrets.GH_TOKEN }}
140142
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
141143
storybookBuildDir: "storybook-static"
144+
- name: Publish to Chromatic - Is Skipped
145+
if: ${{ env.HAVE_CHROMATIC_PROJECT_TOKEN == 'true' }}
146+
run: |
147+
echo "secrets.CHROMATIC_PROJECT_TOKEN not existing, chromatic did not publish"
142148
143149
- name: Package storybook files
144150
uses: actions/upload-artifact@v4 #provide nice artifact

0 commit comments

Comments
 (0)