Skip to content

chore(e2e): Update Playwright E2E Snapshots (#3139) #586

chore(e2e): Update Playwright E2E Snapshots (#3139)

chore(e2e): Update Playwright E2E Snapshots (#3139) #586

name: Update E2E Snapshots
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
oisy-backend-wasm:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build oisy-backend WASM
uses: ./.github/actions/oisy-backend
update_snapshots:
runs-on: ubuntu-24.04
needs: oisy-backend-wasm
steps:
- name: Fail if branch is main
if: ${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' }}
run: |
echo "This workflow should not be triggered with workflow_dispatch on main"
exit 1
- name: Checkout
uses: actions/checkout@v4
- name: Deploy the backend
uses: ./.github/actions/deploy-backend
- name: Prepare
uses: ./.github/actions/prepare
- name: Run Playwright tests
run: npm run e2e:snapshots
- name: Commit Playwright updated snapshots
uses: EndBug/add-and-commit@v9
if: ${{ github.ref != 'refs/heads/main' }}
with:
add: e2e
default_author: github_actions
message: "🤖 update E2E snapshots"
- name: Stage Changes
if: github.ref == 'refs/heads/main'
run: git add .
- name: Check for Changes
if: github.ref == 'refs/heads/main'
run: |
if ! git diff --cached --quiet; then
echo "CHANGES_DETECTED=true" >> $GITHUB_ENV
MODIFIED_FILES=$(git diff --cached --name-only)
echo "MODIFIED_FILES<<EOF" >> $GITHUB_ENV
echo "$MODIFIED_FILES" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
fi
- name: Create Pull Request (if changes and on main)
if: github.ref == 'refs/heads/main' && env.CHANGES_DETECTED == 'true'
uses: ./.github/actions/create-pr
with:
token: ${{ secrets.GIX_CREATE_PR_PAT }}
branch: bot-e2e-update-snapshots
title: 'chore(e2e): Update Playwright E2E Snapshots'
body: |
The following E2E snapshots have been updated:
```
${{ env.MODIFIED_FILES }}