Skip to content

Commit

Permalink
Merge pull request #118 from storybookjs/fix/error-output-to-action
Browse files Browse the repository at this point in the history
chore(CI): add sb versions to report [skip release]
  • Loading branch information
yannbf committed Jun 6, 2022
2 parents cc538a7 + fedd386 commit 808b7d3
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
30 changes: 24 additions & 6 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,34 @@ jobs:
- name: Install dependencies
uses: bahmutov/npm-install@v1

- name: Get current version of Storybook
run: |
echo "prev_sb_version=$(yarn list @storybook/react --depth=0 2> /dev/null | grep @storybook/react | awk -F'@' '{print $3}')" >> $GITHUB_ENV
echo "prev_sb_csf_version=$(yarn list @storybook/csf --depth=0 2> /dev/null | grep @storybook/csf | awk -F'@' '{print $3}')" >> $GITHUB_ENV
- name: Upgrade to storybook@next
run: |
npx storybook upgrade --prerelease
- name: Run test runner
# TODO: This should not be necessary once @storybook/csf is properly updated
- name: Fix local @storybook/csf version
run: |
yarn build
yarn test-storybook:ci
yarn add @storybook/[email protected]
- name: Run test runner
uses: mathiasvr/command-output@v1
id: tests
with:
run: |
yarn build
yarn test-storybook:ci
- name: Get prerelease version of Storybook
if: ${{ failure() }}
run: |
echo "sb_version=$(npm view @storybook/react@prerelease version)" >> $GITHUB_ENV
echo "sb_version=$(yarn list @storybook/react --depth=0 2> /dev/null | grep @storybook/react | awk -F'@' '{print $3}')" >> $GITHUB_ENV
echo "sb_csf_version=$(yarn list @storybook/csf --depth=0 2> /dev/null | grep @storybook/csf | awk -F'@' '{print $3}')" >> $GITHUB_ENV
- name: Report incoming errors
if: ${{ failure() }}
id: slack
Expand All @@ -55,7 +69,11 @@ jobs:
"fields": [
{
"type": "mrkdwn",
"text": "*Storybook version:*\n${{ env.sb_version }}"
"text": "*@storybook/react version:*\n${{ env.prev_sb_version }} >> ${{ env.sb_version }}"
},
{
"type": "mrkdwn",
"text": "*@storybook/csf version:*\n${{ env.prev_sb_csf_version }} >> ${{ env.sb_csf_version }}"
}
],
"accessory": {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push]
jobs:
release:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'skip release')"
steps:
- uses: actions/checkout@v2

Expand Down
3 changes: 3 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@ module.exports = {
storyStoreV7: process.env.STORY_STORE_V7 ? true : false,
buildStoriesJson: true,
},
core: {
disableTelemetry: true
}
};

0 comments on commit 808b7d3

Please sign in to comment.