chore: update the workflow of "Check pull request target"

This commit is contained in:
Andy Pan 2023-06-30 21:17:48 +08:00
parent 46f9b68028
commit 89ecc3ff68
1 changed files with 5 additions and 3 deletions

View File

@ -1,17 +1,19 @@
name: Check pull request target
on:
pull_request_target:
pull_request:
types:
- opened
- reopened
- synchronize
branches:
- master
jobs:
check-branches:
runs-on: ubuntu-latest
steps:
- name: Check target branch
run: |
if [ ${{ github.base_ref }} == "master" ] && [ ${{ github.head_ref }} != "dev" ]; then
if [ ${{ github.head_ref }} != "dev" ]; then
echo "Only pull requests from dev branch are only allowed to be merged into master branch."
exit 1
fi
fi