Skip to content

Commit

Permalink
chore: update the workflow of pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
panjf2000 committed Jun 30, 2023
1 parent 5b6724e commit 676a5ad
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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/*'

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 676a5ad

Please sign in to comment.