Skip to content

Commit

Permalink
chore(CI): Add check for PR target branch (#15197)
Browse files Browse the repository at this point in the history
  • Loading branch information
srebhan authored Apr 19, 2024
1 parent 6bb3d32 commit 2de8026
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/milestones.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: milestones
name: Milestones
on:
pull_request_target:
types:
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/pr-target-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Target Branch
on:
pull_request:
types:
- opened
- reopened
- synchronize
- edited

jobs:
check-target-master:
name: master
runs-on: ubuntu-latest
steps:
- name: debug
run: echo Target is ${{ github.event.pull_request.base.ref }}
- name: success
if: github.event.pull_request.base.ref == 'master'
run: exit 0
- name: error
if: github.event.pull_request.base.ref != 'master'
run: |
echo "Pull-request is not based on master, please rebase"
exit 1

0 comments on commit 2de8026

Please sign in to comment.