Fix duplicate workflow runs: Use Option A - run CI once for PRs, only push to protected branches

This commit is contained in:
adilallo
2025-08-29 21:38:01 -06:00
parent 62b1fd3d4a
commit 42a2fda6eb
+6 -5
View File
@@ -4,9 +4,10 @@ run-name: ${{ gitea.actor }} triggered CI pipeline
on:
workflow_dispatch: {}
push:
branches: [main, develop, "fix-runner-trigger"]
branches: [main, develop] # only direct pushes/merges to protected branches
pull_request:
branches: [main, develop]
branches: [main, develop] # PRs into main/develop
types: [opened, reopened, synchronize]
jobs:
canary:
@@ -92,9 +93,9 @@ jobs:
env: { CI: true }
- run: npx wait-on http://localhost:3000
# Seed snapshots on main branch only (one-time setup)
- name: Seed snapshots (main only)
if: github.ref == 'refs/heads/main'
# Seed snapshots on main branch only (one-time setup)
- name: Seed snapshots (main only)
if: gitea.ref == 'refs/heads/main'
run: PLAYWRIGHT_UPDATE_SNAPSHOTS=1 npx playwright test tests/e2e/visual-regression.spec.ts --project=chromium
env: { CI: true }