Skip to content

Commit dea5687

Browse files
committed
Use a conditional environment
1 parent adb53b6 commit dea5687

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

.github/workflows/build-storybook.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@ on:
66
STORYBOOK_TOKEN:
77
required: true
88

9+
env:
10+
# For a `pull_request` event, the branch is `github.head_ref``.
11+
# For a `push` event, the branch is `github.ref_name`.
12+
BRANCH: ${{ github.head_ref || github.ref_name }}
13+
914
jobs:
1015
build-storybook:
1116
name: Build storybook
1217
runs-on: ubuntu-latest
1318
timeout-minutes: 30
14-
environment: default-branch
15-
env:
16-
# For a `pull_request` event, the branch is `github.head_ref``.
17-
# For a `push` event, the branch is `github.ref_name`.
18-
BRANCH: ${{ github.head_ref || github.ref_name }}
19+
environment: ${{ env.BRANCH == 'main' && 'default-branch' }}
1920
steps:
2021
- name: Checkout and setup high risk environment
2122
uses: MetaMask/action-checkout-and-setup@v1

0 commit comments

Comments
 (0)