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

Latest commit

 

History

History
87 lines (60 loc) · 2.45 KB

README.md

File metadata and controls

87 lines (60 loc) · 2.45 KB

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-head-branch

action-restrict-head-branch

license Github

Restrict pull requests to only be able to be created on specific branches.

👏 Getting Started

Create a workflow file under .github/workflows directory.

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

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

🔧 Configurations

rules

A list of rules that restrict pull requests to be created from only certain branches.

Each rule is a list of branch patterns separated by spaces.

If you want to create pull requests only from the main, staging, and development branches, configure as follows.

rules: |
  main staging development

You can also use Glob to specify the branch name.

Minimatch is used for the matching process.

If you want to create only pull requests from feature and bug fix branches, configure as follows.

rules: |
  feature/* bugfix/*

Also, line breaks can be inserted for readability, as shown below.

rules: |
  main staging development
  feature/* bugfix/* refactor/* chore/* deps/*

This is equivalent to the following rule.

rules: |
  main staging development feature/* bugfix/* refactor/* chore/* deps/*

🤝 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.