All Projects → TimonVS → Pr Labeler Action

TimonVS / Pr Labeler Action

Automatically labels your PRs based on branch name patterns like feature/* or fix/*.

Programming Languages

typescript
32286 projects

Labels

PR Labeler

All Contributors

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

Usage

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

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

jobs:
  pr-labeler:
    runs-on: ubuntu-latest
    steps:
      - uses: TimonVS/[email protected]
        with:
          configuration-path: .github/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Configuration

Configure by creating a .github/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 the branch name feature/218-add-emoji-support the Action will automatically apply the feature label.

Wildcard branches in configuration

You can use * as a wildcard for matching multiple branch 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/*'],
fix: 'fix/*',
chore: 'chore/*'

Contributors ✨

Thanks goes to these wonderful people (emoji key):

🤔 ⚠️ 📖 Clemens Bastian
Clemens Bastian

💻 📖 🐛
Hugo van Rijswijk
Hugo van Rijswijk

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].