Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ permissions:

jobs:
test:
if: (github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || github.head_ref == 'trunk'
name: Test and typecheck
runs-on: ubuntu-latest

Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/trunk-guard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Trunk guard

# Only the `trunk` branch may merge into main. Feature branches merge into
# `trunk` (via the merge train); CI runs only on the trunk -> main PR.
on:
pull_request:
branches: [main]

jobs:
only-trunk-merges-to-main:
if: github.head_ref != 'trunk'
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- run: |
echo "::error::Only the 'trunk' branch may merge into main. Retarget this PR to 'trunk'."
exit 1
Loading