Skip to content

Commit

Permalink
Improve user experience when forked to not fail if chromatic is no co…
Browse files Browse the repository at this point in the history
…nfigured
  • Loading branch information
duttonw committed Apr 10, 2024
1 parent 07dfd9d commit f2f82d7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/compile.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ concurrency:
jobs:
build:
runs-on: ubuntu-latest
env:
HAVE_CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN != '' }}
strategy:
matrix:
node: [ '20' ]
Expand Down Expand Up @@ -131,14 +133,21 @@ jobs:
npm run build-storybook
- name: Publish to Chromatic
if: ${{ github.actor != 'dependabot[bot]' }}
if: ${{ github.actor != 'dependabot[bot]' && env.HAVE_CHROMATIC_PROJECT_TOKEN == 'true' }}
uses: chromaui/action@latest
# Options required to the GitHub Chromatic Action
with:
# 👇 Chromatic projectToken, refer to the manage page to obtain it.
token: ${{ secrets.GH_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
storybookBuildDir: "storybook-static"
- name: Publish to Chromatic - Is Skipped
if: ${{ env.HAVE_CHROMATIC_PROJECT_TOKEN != 'true' }}
run: |
echo "### Chromatic not configured" >> $GITHUB_STEP_SUMMARY
echo "secrets.CHROMATIC_PROJECT_TOKEN not existing, chromatic did not publish" >> $GITHUB_STEP_SUMMARY
echo "If this is a fork, please setup your own personal chromatic at" >> $GITHUB_STEP_SUMMARY
echo "[chromatic setup](https://www.chromatic.com/setup)" >> $GITHUB_STEP_SUMMARY
- name: Package storybook files
uses: actions/upload-artifact@v4 #provide nice artifact
Expand Down

0 comments on commit f2f82d7

Please sign in to comment.