An action to check if I my PR branches is allowed to merge by branch's name
Case: master branch only accept code/pr from develop
name: pr-pipeline
on: pull_request
jobs:
block-pr:
name: check-pr-branches
runs-on: ubuntu-latest
steps:
- uses: italojs/check-pr-branches@v1
with:
when_base: master
allow_only: develop
all args is required*
- when_base: when the base code is <branch_name> (we accept regex)
- allow_only: allow the merge if the compare branch is <branch_name> (we accept regex)
Example:
only accept to merge into master when the compare branch
matches with release\/([0-9]).([0-9]).[0-9]
pattern
uses: italojs/check-pr-branches@v1
with:
when_base: master
allow_only: release\/([0-9]).([0-9]).[0-9]