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)