Skip to content

JJayet/pr-labeler-action

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

Hublo PR Labeler

A GitHub Action that automatically applies labels to your PRs based on commit message patterns like feature* or fix*. Can be used in combination with Release Drafter to automatically categorize pull requests.

Usage

Add .github/workflows/hublo-pr-labeler.yml with the following:

name: PR Labeler
on:
  pull_request:
    types: [opened]

jobs:
  pr-labeler:
    runs-on: ubuntu-latest
    steps:
      - uses: jonathanhublo/hublo-labeler-action@v1
        with:
          configuration-path: .github/hublo-pr-labeler.yml # optional, .github/hublo-pr-labeler.yml is the default value
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Configuration

Configure by creating a .github/hublo-pr-labeler.yml file.

For example:

feature: ['feature/*', 'feat/*']
fix: fix/*
chore: chore/*
fixed-branch: fixed-branch-name

Then if a pull request is opened with a message like feat(emoji): add emoji support the Action will automatically apply the feature label.

Wildcard in configuration

You can use * as a wildcard for matching multiple names. See https://www.npmjs.com/package/matcher for more information about wildcard options.

Default configuration

When no configuration is provided, the following defaults will be used:

feature: ['feature*', 'feat*', 'enhancement*'],
bug: 'fix*',
maintenance: ['chore*', 'style*', 'refactor*', 'build*', 'perf*', 'test*', 'ci*'],
documentation: 'docs*',
revert: 'revert*'

Contributions of any kind welcome!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published