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

agaroot-technologies/action-restrict-pr-label

 
 

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-pr-label

action-restrict-pr-label

license Github

Restrict pull request labels based on the combination of the base and head branches.

👏 Getting Started

Create a workflow file under .github/workflows directory.

name: Restrict pr label
on:
  pull_request_target:
    types: [opened, edited, synchronize]

jobs:
  restrict-pr-label:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
    steps:
      - uses: agaroot-technologies/action-restrict-pr-label@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          rules: |
            main <- staging [release] [production]
            staging <- development [release] [staging]
            development <- feature/* [feature]
            development <- bugfix/* [bugfix]
            development <- refactor/* [refactor]
            development <- chore/* [chore]
            development <- deps/* [deps]

🔧 Configurations

rules

A list of rules that restrict labels for pull requests based on the combination of base and head branches.

Each rule is a list of branch patterns separated by <- and label names enclosed in [].

If you want to add a release label when you submit a PR from the development branch to the main branch, configure as follows.

rules: |
  main <- development [release]

Multiple label names can be specified, separated by spaces.

rules: |
  main <- development [release] [production]

You can also use Glob to specify the branch name.

Minimatch is used for the matching process.

If you want to add a feature label when submitting a PR from a feature branch to a development branch, configure as follows

rules: |
  development <- feature/* [feature]

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

rules: |
  main <- development [release]
  development <- feature/* [feature]

🤝 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 96.0%
  • JavaScript 4.0%