chore: update the workflow of pull requests

This commit is contained in:
Andy Pan 2023-06-30 20:30:36 +08:00
parent 2c599b83a1
commit 46f9b68028
3 changed files with 20 additions and 1 deletions

17
.github/workflows/pull-request.yml vendored Normal file
View File

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

View File

@ -10,6 +10,7 @@ on:
- '.github/FUNDING.yml'
- '.github/release-drafter.yml'
- '.github/ISSUE_TEMPLATE/*'
- '.github/workflows/pull-request.yaml'
- '.github/workflows/release-drafter.yaml'
- 'examples/*'
pull_request:
@ -21,6 +22,7 @@ on:
- '.github/FUNDING.yml'
- '.github/release-drafter.yml'
- '.github/ISSUE_TEMPLATE/*'
- '.github/workflows/pull-request.yaml'
- '.github/workflows/release-drafter.yaml'
- 'examples/*'

View File

@ -6,7 +6,7 @@
- Review existing issues and provide feedback or react to them.
## With pull requests:
- Open your pull request against `master`.
- Open your pull request against `dev`.
- Open one pull request for only one feature/proposal, if you have several those, please put them into different PRs, whereas you are allowed to open one pull request with several bug-fixs.
- Your pull request should have no more than two commits, if not, you should squash them.
- It should pass all tests in the available continuous integrations systems such as TravisCI.