-
Notifications
You must be signed in to change notification settings - Fork 1.2k
28 lines (25 loc) · 855 Bytes
/
pr-check.yml
File metadata and controls
28 lines (25 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
name: Make sure PRs target the develop branch
on:
pull_request_target:
# By default, pull_request_target gets write permissions to the repo - this prevents that
permissions:
pull-requests: write
jobs:
check-branch:
if: github.event.pull_request.base.ref == 'master'
runs-on: ubuntu-latest
steps:
- name: Add comment
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Please do not submit against `master`, use `develop` instead'
})
- name: Throw error
run: |
echo "::error title=wrong-branch::Please do not submit against 'master', use 'develop' instead"
exit 1