chore(CI): Add check for PR target branch (#15197)

This commit is contained in:
Sven Rebhan 2024-04-19 16:13:41 -04:00 committed by GitHub
parent 6bb3d32da9
commit 2de80263d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 25 additions and 1 deletions

View File

@ -1,4 +1,4 @@
name: milestones
name: Milestones
on:
pull_request_target:
types:

24
.github/workflows/pr-target-branch.yml vendored Normal file
View File

@ -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