Skip to content

ci: stop running unit/integration/e2e twice per PR push - #4

Merged
samkim merged 1 commit into
mainfrom
fix/ci-dedupe-push-pr
Sep 28, 2026
Merged

samkim merged 1 commit into
mainfrom
fix/ci-dedupe-push-pr

Conversation

@josephschorr

@josephschorr josephschorr commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

Problem

The CI workflow triggers on both events with no filters:

on:
  push:
  pull_request:

Pushing a commit to a branch with an open PR fires two events for that same commit — push and pull_request (synchronize) — so every job (unit, integration, e2e, frontend) runs twice, once shown as (push) and once as (pull_request) in the Checks UI. Same tests, same commit, double the CI minutes (e2e alone is 90 min).

Fix

on:
  push:
    branches: [main]
  pull_request:
  • PR branches → only pull_request runs (once per push). Duplicate gone.
  • main (after merge) → only push runs, so main stays validated.

Plus a concurrency group that cancels superseded PR runs on re-push, but never cancels main runs (so every merge commit is fully validated):

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

Verification

  • actionlint passes clean on the updated workflow.
  • YAML parses; trigger/concurrency/job structure confirmed.

Both `push` and `pull_request` were unfiltered, so pushing to a branch
with an open PR fired both events for the same commit — running every
job (unit, integration, e2e, frontend) twice, once as `(push)` and once
as `(pull_request)`.

Scope `push` to `main` so PR branches are covered by `pull_request`
alone while `main` stays validated after merges, and add a concurrency
group that cancels superseded PR runs (never `main` runs).
@samkim
samkim merged commit 3373ae6 into main Sep 28, 2026
4 checks passed
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.

2 participants