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 name: Check pull request target
on: on:
pull_request_target: pull_request:
types: types:
- opened - opened
- reopened - reopened
- synchronize - synchronize
branches:
- master
jobs: jobs:
check-branches: check-branches:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check target branch - name: Check target branch
run: | 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." echo "Only pull requests from dev branch are only allowed to be merged into master branch."
exit 1 exit 1
fi fi