Skip to content

Commit 32e43ca

Browse files
authored
CI - Only allow release/* branches to merge into master (#124)
## Description of Changes Redo these PRs: - clockworklabs/com.clockworklabs.spacetimedbsdk-archive#56 - clockworklabs/com.clockworklabs.spacetimedbsdk-archive#59 - clockworklabs/com.clockworklabs.spacetimedbsdk-archive#61 I'm not sure how these repos were merged in #117, but it appears that this wasn't carried over. (Either way we need to make this a required check). ## API No ## Requires SpacetimeDB PRs *List any PRs here that are required for this SDK change to work* Co-authored-by: Zeke Foppa <[email protected]>
1 parent 732dd28 commit 32e43ca

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/check-pr-base.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Git tree checks
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, reopened, synchronize]
6+
merge_group:
7+
permissions: read-all
8+
9+
jobs:
10+
check_base_ref:
11+
name: Only release branches may merge into master
12+
runs-on: ubuntu-latest
13+
steps:
14+
- id: not_based_on_master
15+
if: |
16+
github.event_name == 'pull_request' &&
17+
github.event.pull_request.base.ref == 'master' &&
18+
! startsWith(github.event.pull_request.head.ref, 'release/')
19+
run: |
20+
echo 'Only `release/*` branches are allowed to merge into `master`.'
21+
echo 'Maybe your PR should be merging into `staging`?'
22+
exit 1

0 commit comments

Comments
 (0)