Skip to content

Conversation

@carbonrobot
Copy link

@carbonrobot carbonrobot commented Dec 2, 2024

Support the deployment_status event type for Github Actions.

This allows consumers to support running Playwright or Cypress tests after a deployment is complete to a third party platform such as Vercel when using the action in the same workflow file.

Fixes #647

Example Configuration

The following configuration currently exits with an error for unsupported event type. This PR fixes the error.

name: Chromatic

on:
  deployment_status:
  
jobs:
  playwright:
    container:
      image: mcr.microsoft.com/playwright:v1.49.0-jammy
    steps:
      - uses: actions/checkout@v4
      
      - name: Run Playwright Tests
        run: npx playwright test
        env:
          PLAYWRIGHT_TEST_BASE_URL: ${{ github.event.deployment_status.target_url }}
          
      - uses: actions/upload-artifact@v4
        if: always()
        with:
          name: playwright-results
          path: ./playwright-report
          retention-days: 30

  chromatic:
    name: Run Chromatic
    needs: playwright
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4 
      
      - uses: actions/download-artifact@v4
        with:
          path: ${{ github.workspace }}
          
      - name: Chromatic
        uses: chromaui/action@latest
        with:
          playwright: true
          projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}

@carbonrobot
Copy link
Author

carbonrobot commented Dec 3, 2024

Currently blocked by the same problem with deployment_status missing the branch ref as describe in actions/cache#319; but exploring workarounds.

@ImranSefat
Copy link

@carbonrobot hey, we are having the exact same problem on the deployment status check. Did you find a workaround for this with chromatic? Thanks!

@carbonrobot
Copy link
Author

@ImranSefat We explored a few different options, but ultimately the data is simply not there in the trigger without writing an entire custom script to get it using git commands. And even then, the consistency was not reliable.

@ethriel3695
Copy link
Contributor

I explained the reason for a duplicate PR here:
#1165

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chroma GH Action

3 participants