Fix duplicate workflow runs: Use Option A - run CI once for PRs, only push to protected branches
This commit is contained in:
@@ -4,9 +4,10 @@ run-name: ${{ gitea.actor }} triggered CI pipeline
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch: {}
|
workflow_dispatch: {}
|
||||||
push:
|
push:
|
||||||
branches: [main, develop, "fix-runner-trigger"]
|
branches: [main, develop] # only direct pushes/merges to protected branches
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main, develop]
|
branches: [main, develop] # PRs into main/develop
|
||||||
|
types: [opened, reopened, synchronize]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
canary:
|
canary:
|
||||||
@@ -92,9 +93,9 @@ jobs:
|
|||||||
env: { CI: true }
|
env: { CI: true }
|
||||||
- run: npx wait-on http://localhost:3000
|
- run: npx wait-on http://localhost:3000
|
||||||
|
|
||||||
# Seed snapshots on main branch only (one-time setup)
|
# Seed snapshots on main branch only (one-time setup)
|
||||||
- name: Seed snapshots (main only)
|
- name: Seed snapshots (main only)
|
||||||
if: github.ref == 'refs/heads/main'
|
if: gitea.ref == 'refs/heads/main'
|
||||||
run: PLAYWRIGHT_UPDATE_SNAPSHOTS=1 npx playwright test tests/e2e/visual-regression.spec.ts --project=chromium
|
run: PLAYWRIGHT_UPDATE_SNAPSHOTS=1 npx playwright test tests/e2e/visual-regression.spec.ts --project=chromium
|
||||||
env: { CI: true }
|
env: { CI: true }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user