Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
tag

GitHub Action

PR Labeler

v2.1.0

PR Labeler

tag

PR Labeler

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

Installation

Copy and paste the following snippet into your .yml file.

              

- name: PR Labeler

uses: TimonVS/pr-labeler-action@v2.1.0

Learn more about this action in TimonVS/pr-labeler-action

Choose a version

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/pr-labeler-action@master
        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.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Timon van Spronsen
Timon van Spronsen

💻 🤔 ⚠️ 📖
Clemens Bastian
Clemens Bastian

💻 📖 🐛

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