ci/ui-test: key concurrency by head sha, not gitea.ref
Tests · UI / test (push) Has been cancelled
Tests · UI / test (pull_request) Successful in 2m17s

`gitea.ref` differs between push (`refs/heads/<branch>`) and
pull_request (`refs/pull/N/head`) events even for the same commit,
so the two parallel runs land in different concurrency groups and
the Vite-on-:5173 collision is not suppressed. Switching the key to
the head sha (`gitea.event.pull_request.head.sha || gitea.sha`)
collapses both events into one bucket, leaving exactly one ui-test
alive per commit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilia Denisov
2026-05-15 08:46:00 +02:00
parent e3bb30201d
commit 6e6186a571
+3 -3
View File
@@ -19,10 +19,10 @@ on:
# Playwright launches its own `pnpm dev` on :5173. In host-mode the
# runner shares the host's port namespace, so two parallel ui-test
# jobs (e.g. a push event racing with a pull_request event for the
# same commit) collide on EADDRINUSE. Group by branch/ref and cancel
# the in-progress run so only one ui-test is alive at a time per ref.
# same commit) collide on EADDRINUSE. Group by the head commit so
# push and pull_request events for the same sha share one bucket.
concurrency:
group: ui-test-${{ gitea.ref }}
group: ui-test-${{ gitea.event.pull_request.head.sha || gitea.sha }}
cancel-in-progress: true
jobs: