name: Update E2E Snapshots on: workflow_dispatch: inputs: branch: description: "Branch to update snapshots on" required: true default: "main" # Temporary: auto-run on this branch to update snapshots push: branches: - "ochafik/fix-e2e-flaky-tests" paths: - ".github/workflows/update-snapshots.yml" permissions: contents: write jobs: update-snapshots: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: ref: ${{ github.event.inputs.branch || github.ref }} token: ${{ secrets.GITHUB_TOKEN }} - uses: oven-sh/setup-bun@v2 with: bun-version: latest - uses: actions/setup-node@v4 with: node-version: "20" - uses: astral-sh/setup-uv@v5 - run: npm ci - name: Install Playwright browsers run: npx playwright install --with-deps chromium - name: Update snapshots run: npx playwright test --update-snapshots --reporter=list - name: Commit updated snapshots run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add tests/e2e/**/*.png git diff --staged --quiet || git commit -m "chore: update e2e snapshots [skip ci]" git push