Skip to content

Commit 86fd005

Browse files
authored
CI: Re-run lint when a PR's base branch changes (#676)
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.
1 parent d333202 commit 86fd005

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.github/workflows/lint.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ run-name: Lint (${{ github.head_ref || github.ref_name }})
33

44
on:
55
pull_request:
6+
# 'edited' so the lint re-runs when a PR's base branch is changed; otherwise
7+
# retargeting (e.g. main -> dev) leaves the required SwiftFormat check with no
8+
# run on the new base and the PR stays blocked indefinitely.
9+
types: [opened, synchronize, reopened, edited]
610
workflow_dispatch:
711

812
concurrency:
@@ -15,6 +19,9 @@ permissions:
1519
jobs:
1620
swiftformat:
1721
name: SwiftFormat
22+
# Run on open/sync/reopen always; on 'edited' only when the base branch
23+
# actually changed, so routine title/description edits don't re-lint.
24+
if: ${{ github.event.action != 'edited' || github.event.changes.base != null }}
1825
runs-on: ubuntu-latest
1926
container: swift:6.0
2027
steps:

0 commit comments

Comments
 (0)