File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Make sure PRs target the develop branch
2+
3+ on :
4+ pull_request_target :
5+
6+ # By default, pull_request_target gets write permissions to the repo - this prevents that
7+ permissions :
8+ pull-requests : write
9+
10+ jobs :
11+ check-branch :
12+ if : github.event.pull_request.base.ref == 'master'
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Add comment
16+ uses : actions/github-script@v7
17+ with :
18+ script : |
19+ github.rest.issues.createComment({
20+ issue_number: context.issue.number,
21+ owner: context.repo.owner,
22+ repo: context.repo.repo,
23+ body: 'Please do not submit against `master`, use `develop` instead'
24+ })
25+ - name : Throw error
26+ run : |
27+ echo "::error title=wrong-branch::Please do not submit against 'master', use 'develop' instead"
28+ exit 1
You can’t perform that action at this time.
0 commit comments