Skip to content

Commit

Permalink
ci: Add PR comment
Browse files Browse the repository at this point in the history
  • Loading branch information
amattu2 committed May 13, 2024
1 parent 17870a6 commit feb346e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,24 @@ jobs:
run: npm install

- name: Build & Publish Storybook
id: publish
uses: chromaui/action@v1
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
buildScriptName: "storybook-build"

# If the build is successful and the action is triggered by a PR, comment on the PR with the Chromatic URL
- name: PR Comment
if: github.event_name == 'pull_request' && steps.publish.outcome == 'success'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Changes published to Chromatic. Review at: ${steps.publish.outputs.storybookUrl}`
})

0 comments on commit feb346e

Please sign in to comment.