Skip to content

Commit

Permalink
fix: create preview for draft PRs (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
prescottprue authored Sep 4, 2024
1 parent 4d6ccf2 commit d767aaf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/actions/storybook/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ inputs:
percy-token:
description: 'Token for Percy'
required: true
skip-percy:
description: 'Whether or not to skip Percy - if skipped build still runs and preview url is still generated'
required: false
default: 'false'
outputs:
preview-url:
description: 'URL of Storybook Preview'
Expand All @@ -16,6 +20,7 @@ runs:
shell: bash

- name: Percy Visual Testing
if: inputs.skip-percy != 'true'
env:
PERCY_TOKEN: ${{ inputs.percy-token }}
run: yarn percy
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/verify_library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,13 @@ jobs:
service-account: ${{ secrets.CI_SERVICE_ACCOUNT }}

- name: Run Storybook and upload preview
# Skip running of Percy through storybook if PR is dependecy updates or if PR is draft
if: inputs.ENABLE_VISUAL_TESTING && github.actor != 'renovate[bot]' && (github.event_name == 'merge_group' || github.event.pull_request.draft != true)
if: inputs.ENABLE_VISUAL_TESTING
uses: reside-eng/workflow-templates-library/.github/actions/storybook@v1
id: storybook
with:
percy-token: ${{ secrets.PERCY_TOKEN }}
# Skip running of Percy through storybook if PR is dependecy updates or if PR is draft
skip-percy: ${{ github.actor == 'renovate[bot]' || github.event.pull_request.draft == true }}

- name: Comment preview links
if: steps.storybook.outputs.preview-url != '' || steps.playwright.outputs.preview-url != ''
Expand Down

0 comments on commit d767aaf

Please sign in to comment.