Skip to content

Commit 470017a

Browse files
committed
ci: require main pull requests from dev
1 parent 517ea99 commit 470017a

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Main source guard
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
require-dev-source:
13+
name: Only dev can merge to main
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Verify pull request source branch
17+
env:
18+
HEAD_REF: ${{ github.head_ref }}
19+
run: |
20+
if [ "$HEAD_REF" != "dev" ]; then
21+
echo "::error::Pull requests to main must come from the dev branch."
22+
exit 1
23+
fi

0 commit comments

Comments
 (0)