Skip to content

refactor: storybook url comment add (#172) #12

refactor: storybook url comment add (#172)

refactor: storybook url comment add (#172) #12

Workflow file for this run

name: "Chromatic Deployment"
on: push
jobs:
chromatic-deployment:
name: Chromatic
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install dependencies
run: yarn
- name: Publish to Chromatic
id: chromatic
uses: chromaui/action@v1
with:
exitZeroOnChanges: true
autoAcceptChanges: true
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
- name: Get PR data
uses: actions/github-script@v7
id: get_pr_data
with:
script: |
return (
await github.rest.repos.listPullRequestsAssociatedWithCommit({
commit_sha: context.sha,
owner: context.repo.owner,
repo: context.repo.repo,
})
).data[0];
- name: Pull Request data
run: |
echo '${{ fromJson(steps.get_pr_data.outputs.result).number }}'
echo '${{ fromJson(steps.get_pr_data.outputs.result).title }}'
# - name: Comment PR
# uses: thollander/actions-comment-pull-request@v3
# with:
# message: |
# Hello world ! :wave:
- name: comment PR
uses: thollander/actions-comment-pull-request@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
message: "🚀storybook: ${{ steps.chromatic.outputs.storybookUrl }}"
# - name: Save PR number and Chromatic build outputs
# run: |
# mkdir -p ./pr
# echo "${{ github.event.pull_request.number }}" > ./pr/prNumber
# echo "${{ steps.chromatic.outputs.storybookUrl }}" > ./pr/storybookUrl
# echo "${{ steps.chromatic.outputs.buildUrl }}" > ./pr/buildUrl