From 6892e669feb46f73f2f489a8c90f5b8ff91c156b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bj=C3=B6rkert?= Date: Wed, 17 Jun 2026 20:19:04 +0200 Subject: [PATCH] CI: Re-run lint when a PR's base branch changes Add 'edited' to the lint workflow's pull_request trigger, guarded so the SwiftFormat job only re-runs when the base branch actually changed. Retargeting a PR (e.g. main -> dev) fires pull_request: edited, which the default trigger types (opened, synchronize, reopened) ignore. When the new base requires the SwiftFormat status check, GitHub leaves it 'Expected - waiting for status to be reported' with no run behind it, blocking the PR indefinitely. Re-running on base change ensures the required check actually reports against the new base. --- .github/workflows/lint.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 68aa860f6..8b1c217f3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,6 +3,10 @@ run-name: Lint (${{ github.head_ref || github.ref_name }}) on: pull_request: + # 'edited' so the lint re-runs when a PR's base branch is changed; otherwise + # retargeting (e.g. main -> dev) leaves the required SwiftFormat check with no + # run on the new base and the PR stays blocked indefinitely. + types: [opened, synchronize, reopened, edited] workflow_dispatch: concurrency: @@ -15,6 +19,9 @@ permissions: jobs: swiftformat: name: SwiftFormat + # Run on open/sync/reopen always; on 'edited' only when the base branch + # actually changed, so routine title/description edits don't re-lint. + if: ${{ github.event.action != 'edited' || github.event.changes.base != null }} runs-on: ubuntu-latest container: swift:6.0 steps: