diff --git a/.github/actions/storybook/action.yml b/.github/actions/storybook/action.yml index dcc0217..d68f031 100644 --- a/.github/actions/storybook/action.yml +++ b/.github/actions/storybook/action.yml @@ -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' @@ -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 diff --git a/.github/workflows/verify_library.yml b/.github/workflows/verify_library.yml index 53e517d..328ddbb 100644 --- a/.github/workflows/verify_library.yml +++ b/.github/workflows/verify_library.yml @@ -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 != ''