Skip to content

finleyfamily/action-enforce-branch-name

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

GitHub Action: Enforce Branch Name

GitHub Super-Linter CI Check dist/ CodeQL Coverage pre-commit renovate

GitHub Action to enforce a branch naming convention. Inspired by deepakputhraya/action-branch-name.

Important

JavaScript/TypeScript is not my forte. Contributions are welcome and appreciated but I will likely be of little help with any issues encountered when doing so.

Table Of Contents

Usage

name: Enforce Branch Name

on:
  pull_request:

jobs:
  enforce-branch-name:
    name: enforce-branch-name
    runs-on: ubuntu-latest
    steps:
      - name: 💂 Enforce Branch Name
        uses: finleyfamily/action-enforce-branch-name@vx.x.x  # it is HIGHLY recommended to pin this to a release
        with:
          allowed_prefixes: >-
            bugfix,chore,dependabot,docs,feat,feature,fix,hotfix,
            maint,maintain,maintenance,release,renovate

Inputs

Key Description
allowed_prefixes Comma delimited list of prefix that must be used in every branch (e.g. feature,hotfix).
exclude Comma delimited list of branch names to exclude from this check (e.g. main,master). Defaults to main,master,pre-commit-ci-update-config.
regex Regex pattern to validate the branch name. Defaults to ([a-z])+\/([a-zA-Z0-9\-\_])+.

Outputs

This action provides no outputs.