diff --git a/.github/workflows/post-deploy.yml b/.github/workflows/post-deploy.yml index 6d2cf8222..ab328f7e0 100644 --- a/.github/workflows/post-deploy.yml +++ b/.github/workflows/post-deploy.yml @@ -24,7 +24,14 @@ jobs: echo "Workflow triggered by event '${{ github.event_name }}'." echo "Workflow triggered by actor '${{ github.actor }}''." echo "Target url is '${{ github.event.deployment_status.target_url }}''." + - name: Determine E2E_ENDPOINT + run: > + echo E2E_ENDPOINT=$(if [[ "${{ github.event_name }}" == "pull_request" && "${{ github.head_ref }}" != "main" ]]; then + echo "${{ vars.PREVIEW_URL }}/${{ github.head_ref }}"; + else + echo "${{ vars.MAIN_URL }}"; + fi) >> $GITHUB_ENV - name: Run Storybook tests run: pnpm --filter=end-to-end-tests test:storybook --config-dir ./packages/design/.storybook/ --browsers firefox chromium env: - TARGET_URL: '${{ github.event.deployment_status.target_url }}' \ No newline at end of file + TARGET_URL: '${{ env.E2E_ENDPOINT }}' \ No newline at end of file