Skip to content

Commit

Permalink
Merge 4e8fe37 into ea19081
Browse files Browse the repository at this point in the history
  • Loading branch information
HalvorHaugan authored Dec 19, 2024
2 parents ea19081 + 4e8fe37 commit 4a3b13d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
25 changes: 6 additions & 19 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ jobs:
- name: Chromatic
uses: chromaui/action@latest
id: chromatic_tests
continue-on-error: true
continue-on-error: false
with:
autoAcceptChanges: "main"
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
exitZeroOnChanges: false
exitZeroOnChanges: true
buildScriptName: "build:storybook-chromatic"
onlyChanged: true
untraced: "**/package.json|yarn.lock|**/*.md"
Expand All @@ -62,14 +62,14 @@ jobs:
STORYBOOK_GITHUB_SHA: ${{ github.sha }}

- name: Get commit sha
if: "!contains(github.event.head_commit.message, '[ci skip]') && github.event_name != 'push'"
if: github.event_name != 'push' && !contains(github.event.head_commit.message, '[ci skip]')
id: vars
shell: bash
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Find Comment
if: "!contains(github.event.head_commit.message, '[ci skip]') && github.event_name != 'push'"
if: github.event_name != 'push' && !contains(github.event.head_commit.message, '[ci skip]')
uses: peter-evans/find-comment@v2
id: fc
with:
Expand All @@ -78,28 +78,15 @@ jobs:
body-includes: Storybook demo

- name: Create or update comment
if: steps.chromatic_tests.outcome == 'success' && !contains(github.event.head_commit.message, '[ci skip]') && github.event_name != 'push'
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
## [Storybook demo](${{steps.chromatic_tests.outputs.storybookUrl}})
[${{ steps.vars.outputs.sha_short }}](https://github.com/navikt/aksel/commit/${{ steps.vars.outputs.sha_short }}) | ${{steps.chromatic_tests.outputs.componentCount}} komponenter | ${{steps.chromatic_tests.outputs.specCount}} stories
edit-mode: replace

- name: Create or update failed comment
if: steps.chromatic_tests.outcome != 'success' && !contains(github.event.head_commit.message, '[ci skip]') && github.event_name != 'push'
if: github.event_name != 'push' && !contains(github.event.head_commit.message, '[ci skip]')
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
## [Storybook demo](${{steps.chromatic_tests.outputs.storybookUrl}}) / [Chromatic](${{steps.chromatic_tests.outputs.url}})
### 📝 Endringer til review: ${{steps.chromatic_tests.outputs.changeCount}}
${{ steps.chromatic_tests.outputs.changeCount > 0 && format('### 📝 Endringer til gjennomgang: {0}', steps.chromatic_tests.outputs.changeCount) || '' }}
${{ steps.chromatic_tests.outputs.errorCount > 0 && format('### ❌ Stories med feil: {0}', steps.chromatic_tests.outputs.errorCount) || '' }}
${{ steps.chromatic_tests.outputs.interactionTestFailuresCount > 0 && format('### ❌ Feilede interaksjonstester: {0}', steps.chromatic_tests.outputs.interactionTestFailuresCount) || '' }}
Expand Down
1 change: 1 addition & 0 deletions @navikt/core/react/src/accordion/accordion.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const SmallContent = () => (
const Item = ({ defaultOpen = false }) => (
<Accordion.Item defaultOpen={defaultOpen} onOpenChange={console.log}>
<Accordion.Header>Accordion header text</Accordion.Header>
{/* Change that will not cause snapshot change */}
{defaultOpen ? <SmallContent /> : <Content />}
</Accordion.Item>
);
Expand Down

0 comments on commit 4a3b13d

Please sign in to comment.