DEV Community

Cover image for πŸ“¦ Stay Organized and Efficient with Auto-Label-Pulls Github Action
Alvin James Bellero
Alvin James Bellero

Posted on • Edited on

πŸ“¦ Stay Organized and Efficient with Auto-Label-Pulls Github Action

❓ What is auto-label-pulls?

Auto Label Pulls is a robust GitHub Action that can significantly streamline the process of labeling Pull Requests. Its branch-based mechanism offers the flexibility to cater to various project needs, making it an indispensable tool for any GitHub project maintainer.

Whether you have a small project or manage a large repository with tons of pull requests, auto-label-pulls can help you stay organized and save valuable time.



πŸ’‘ Key Features

  • Easy to Set Up: Getting started with auto-label-pulls is a breeze. All you need to do is include the action in your GitHub workflow file and configure the necessary parameters.

  • Automatic Label Assignment: Labels are automatically assigned to new pull requests based on the target branch, removing the need for manual labelling.

  • Customizable: You can configure which labels correspond to which branches, allowing you to use in a way that suits your project's needs.


πŸš€ Getting Started

Using auto-label-pulls is simple and straightforward:

  • First, add the action to your GitHub workflow file (.github/workflows/main.yml).
name: Workflow Name

on:
  pull_request:
    types: [opened]

jobs:
  label:
    runs-on: ubuntu-latest
    steps:
      - name: Assign labels
        uses: shiftEscape/auto-label-pulls@v1.0.0
        with:
          token: "${{ secrets.GITHUB_TOKEN }}"
          config-path: ".github/config/auto-label-pulls.json"
Enter fullscreen mode Exit fullscreen mode

NOTE: Use this action only for pull_request event of type opened.

  • Second, create a configuration file (.github/config/auto-label-pulls.json) for the mapping of labels to branches.
{
  "master": "πŸš€ Production Deployment",
  "develop": "πŸ§ͺ SIT Deployment"
}
Enter fullscreen mode Exit fullscreen mode

In the above example, when a Pull Request is made to master branch, "πŸš€ Production Deployment" label will be assigned to that PR and so on and so forth.

πŸ’‘ Visit the Action's Dashboard for more info: https://github.com/marketplace/actions/auto-label-pulls


πŸ‘ And there you have it, folks!

By incorporating auto-label-pulls into your GitHub workflow, you're not just organizing your process – you're revolutionizing it.

Explore the tool, share your thoughts, and let's transform the open-source space together!

Thanks for reading! πŸ˜‰


Top comments (0)