Skip to content

Commit f3eef01

Browse files
committed
ci: Fix build-storybook workflow again
There are still a couple of issues with the `build-storybook` workflow that prevent it from running effectively. 1. The environment is incorrectly named (should be `default-branch`). I've fixed this. 2. The `deploy-storybook` job is not running even on pushes to `main`. It seems that we are checking for the existence of a `STORYBOOK_TOKEN` environment variable when we should be checking for the secret. Although in practice, the secret has been required this whole time so the conditional seems redundant. I've corrected this by making the secret optional.
1 parent 16b249f commit f3eef01

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/build-storybook.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ on:
44
workflow_call:
55
secrets:
66
STORYBOOK_TOKEN:
7-
required: true
7+
required: false
88

99
jobs:
1010
build-storybook:
1111
name: Build storybook
1212
runs-on: ubuntu-latest
1313
timeout-minutes: 30
14-
environment: ${{ github.ref_name == 'main' && 'default_branch' || null }}
14+
environment: ${{ github.ref_name == 'main' && 'default-branch' || null }}
1515
env:
1616
# For a `pull_request` event, the branch is `github.head_ref``.
1717
# For a `push` event, the branch is `github.ref_name`.
@@ -37,7 +37,7 @@ jobs:
3737
path: storybook-build
3838

3939
- name: Deploy storybook
40-
if: ${{ env.BRANCH == 'main' && env.STORYBOOK_TOKEN }}
40+
if: ${{ env.BRANCH == 'main' && secrets.STORYBOOK_TOKEN }}
4141
env:
4242
STORYBOOK_TOKEN: ${{ secrets.STORYBOOK_TOKEN }}
4343
run: |

0 commit comments

Comments
 (0)