Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

agaroot-technologies/action-restrict-base-branch

 
 

Repository files navigation

Caution

The repository has been archived and will no longer be maintained.
Moving forward, maintenance will be conducted in the following repository:
https://github.com/praha-inc/action-restrict-base-branch

action-restrict-base-branch

license Github

Restrict pull requests to merge only into specific branches.

👏 Getting Started

Create a workflow file under .github/workflows directory.

name: Restrict base branch
on:
  pull_request_target:
    types: [opened, edited, synchronize]

jobs:
  restrict-base-branch:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
    steps:
      - uses: agaroot-technologies/action-restrict-base-branch@v1
        with:
          rules: |
            main <- development
            development <- feature/* bugfix/* refactor/* chore/* deps/*
            feature/* <- feature/**/*

🔧 Configurations

rules

A list of rules that restrict pull requests to be merged into only certain branches.

Each rule is a list of branch patterns separated by <-.

The left-hand side specifies the name of the base branch, and the right-hand side specifies the name of the head branch.

If you want to merge only development branches into the main branch, configure as follows.

rules: |
  main <- development

Multiple branch names can be specified on the right side, separated by spaces.

rules: |
  main <- development staging

You can also use Glob to specify the branch name.

Minimatch is used for the matching process.

If you want to merge only feature and bugfix branches into the development branch, configure as follows.

rules: |
  development <- feature/* bugfix/*

Also, multiple rules can be specified by adding a new line as shown below.

rules: |
  main <- development
  development <- feature/* bugfix/*

🤝 Contributing

Contributions, issues and feature requests are welcome.

Feel free to check issues page if you want to contribute.

📝 License

Copyright © 2020 AGAROOT TECHNOLOGIES.

This project is MIT licensed.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 91.9%
  • JavaScript 8.1%