Skip to content

Commit 7d03133

Browse files
committed
refactor: chromatic yml fix (#172)
1 parent d346fc7 commit 7d03133

File tree

1 file changed

+36
-28
lines changed

1 file changed

+36
-28
lines changed

.github/workflows/chromatic.yml

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,54 +6,62 @@ jobs:
66
chromatic-deployment:
77
name: Chromatic
88
runs-on: ubuntu-latest
9-
permissions:
10-
contents: read
11-
pull-requests: read
9+
outputs:
10+
statis: ${{ job.status }}
11+
# permissions:
12+
# contents: read
13+
# pull-requests: read
1214
steps:
1315
- name: Checkout
14-
uses: actions/checkout@v1
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
1519

1620
- name: Install dependencies
1721
run: yarn
1822

1923
- name: Publish to Chromatic
2024
id: chromatic
21-
uses: chromaui/action@v1
25+
uses: chromaui/action@latest
2226
with:
2327
exitZeroOnChanges: true
2428
autoAcceptChanges: true
2529
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
30+
token: ${{ secrets.TOKEN }}
2631

27-
- name: Get PR data
28-
uses: actions/github-script@v7
29-
id: get_pr_data
30-
with:
31-
script: |
32-
return (
33-
await github.rest.repos.listPullRequestsAssociatedWithCommit({
34-
commit_sha: context.sha,
35-
owner: context.repo.owner,
36-
repo: context.repo.repo,
37-
})
38-
).data[0];
39-
40-
- name: Pull Request data
41-
run: |
42-
echo '${{ fromJson(steps.get_pr_data.outputs.result).number }}'
43-
echo '${{ fromJson(steps.get_pr_data.outputs.result).title }}'
32+
- name: Publish Summary
33+
run: echo -e "Result ${{ steps.chromatic.outputs.buildUrl }} Storybook Preview ${{ steps.chromatic.outputs.storybookUrl }}"
34+
35+
# - name: Get PR data
36+
# uses: actions/github-script@v7
37+
# id: get_pr_data
38+
# with:
39+
# script: |
40+
# return (
41+
# await github.rest.repos.listPullRequestsAssociatedWithCommit({
42+
# commit_sha: context.sha,
43+
# owner: context.repo.owner,
44+
# repo: context.repo.repo,
45+
# })
46+
# ).data[0];
47+
48+
# - name: Pull Request data
49+
# run: |
50+
# echo '${{ fromJson(steps.get_pr_data.outputs.result).number }}'
51+
# echo '${{ fromJson(steps.get_pr_data.outputs.result).title }}'
4452

4553
# - name: Comment PR
4654
# uses: thollander/actions-comment-pull-request@v3
4755
# with:
4856
# message: |
4957
# Hello world ! :wave:
5058

51-
- name: comment PR
52-
uses: thollander/actions-comment-pull-request@v1
53-
env:
54-
GITHUB_TOKEN: ${{ secrets.TOKEN }}
55-
with:
56-
message: "🚀storybook: ${{ steps.chromatic.outputs.storybookUrl }}"
59+
# - name: comment PR
60+
# uses: thollander/actions-comment-pull-request@v1
61+
# env:
62+
# GITHUB_TOKEN: ${{ secrets.TOKEN }}
63+
# with:
64+
# message: "🚀storybook: ${{ steps.chromatic.outputs.storybookUrl }}"
5765

5866
# - name: Save PR number and Chromatic build outputs
5967
# run: |

0 commit comments

Comments
 (0)