DEV Community

Cover image for Programmatically Add Labels to Your Issues
Rizèl Scarlett for GitHub

Posted on • Edited on

7 1

Programmatically Add Labels to Your Issues

For the past week, I’ve been working on building a Probot app that automates inviting users to my GitHub organization. If you read my past blog post, you will learn that I decided to implement a form of triaging by opening an issue for potential members if they star the repository. That was successful, but I realized that other people may open issues in my repository for various reasons – not just to join my organization. I don’t want to weed through multiple issues to figure out if they are requests or not. I prefer to filter for the ones that are requests. An easy way to do that is by adding a label to the issues that include requests to join my organization.

To programmatically add a label to my issues, I added a labels property. The labels property accepts an array of strings representing label names. I used the label ‘pending-invitation’.

Image description

Now, I can filter the issues by the pending-invitation label.

Image description

Image description

Tomorrow, I plan to approve pending issues and them to the organization. Stay tuned, and follow GitHub and me on DEV for more content.

Sentry image

Make it make sense

Make sense of fixing your code with straight-forward application monitoring.

Start debugging →

Top comments (0)

Billboard image

Try REST API Generation for MS SQL Server.

DevOps for Private APIs. With DreamFactory API Generation, you get:

  • Auto-generated live APIs mapped from database schema
  • Interactive Swagger API documentation
  • Scripting engine to customize your API
  • Built-in role-based access control

Learn more

👋 Kindness is contagious

DEV shines when you're signed in, unveiling a customized journey—dark mode and beyond await!

Okay