Labeling by GPT

What I built

I developed a GitHub Action that chooses suitable labels for an opened/edited issue and puts the labels to the issue automatically without predefined rules.

Category Submission:

Maintainer Must-Haves

App Li…


This content originally appeared on DEV Community and was authored by Tatsuya Sato

What I built

I developed a GitHub Action that chooses suitable labels for an opened/edited issue and puts the labels to the issue automatically without predefined rules.

Category Submission:

Maintainer Must-Haves

App Link

Labeling by GPT · Actions · GitHub Marketplace

Screenshots

Image description

You can see this issue and try it by opening new issue!

Description

When an issue is opened/edited, this action reads its title and description, choose suitable labels in the repository and add those labels to the issue.

You don't need to define rules which issue should should have which labels in advance.

Link to Source Code

GitHub logo satoryu / labeling-by-gpt

This action puts labels to an issues in the repository autocratically without pre-defined rule.

Labeling by GPT

When creating new issue, this action puts labels to an issues in the repository autocratically without pre-defined rule. This is powered by OpenAI completion API to choose suitable labels.

Please note that this action supports only issues trigger and the two types: opened and edited.

Inputs

openai-api-key

Required Your OpenAI API Key.

github-token

Optional. GitHub API token to access GitHub API. The default value is secrets.GITHUB_TOKEN, an API token provided for an action. Be sure of that this token has a permission to put labels to an issue. This document would help you.

Example

on:
  issues:
    types: [opened, edited]

jobs:
  test:
    name: test
    runs-on: ubuntu-latest

    steps:
      - uses: satoryu/labeling-by-gpt@main
        with:
          openai-api-key: ${{ secrets.OPENAI_API_KEY }}



Permissive License

MIT License

Background

In maintaining OSS projects, triage is an important activity. GitHub provides 'labeling issues' feature to help maintainers triage their repositories' issues. But triage is boring! As new issue is opened, maintainers have to read its title and description then choose suitable labels and add the labels to it. As issues in a repository increases, the workload of triage increases too. If there were few maintainers of the repo, triage would be impossible.
GitHub Action has the possibility to reduce this workload. But maintainers would define rules in advance in which condition and labels the action should choose and add to an issue.

On the other hand, NLP is getting popular by ChatGPT, OpenAI APIs. OpenAI completion API processes several tasks to a given text 'prompt'. I came up with the idea that this API would help maintainers triage their issues.

This is my motivation to develop this GitHub action.

How I built it

First, I had to confirm that OpenAI completion API works as I want: choose suitable labels from available labels in a repository.
In order to do it, I used ChatGPT:

Image description

Next, I implemented and test it on its repository.
This is quite simple and easy: define a YAML file under .github/workflows.

on:
  issues:
    types: [opened, edited]

jobs:
  test:
    name: test
    runs-on: ubuntu-latest

    steps:
      - uses: satoryu/labeling-by-gpt@main
        with:
          openai-api-key: ${{ secrets.OPENAI_API_KEY }}

Specifying the main branch like satoryu/labeling-by-gpt@main not version (e.g. v0.0.1) always refers to the latest version of this action. This configuration is good for testing on GitHub.

Additional Resources/Info


This content originally appeared on DEV Community and was authored by Tatsuya Sato


Print Share Comment Cite Upload Translate Updates
APA

Tatsuya Sato | Sciencx (2023-05-21T16:17:24+00:00) Labeling by GPT. Retrieved from https://www.scien.cx/2023/05/21/labeling-by-gpt/

MLA
" » Labeling by GPT." Tatsuya Sato | Sciencx - Sunday May 21, 2023, https://www.scien.cx/2023/05/21/labeling-by-gpt/
HARVARD
Tatsuya Sato | Sciencx Sunday May 21, 2023 » Labeling by GPT., viewed ,<https://www.scien.cx/2023/05/21/labeling-by-gpt/>
VANCOUVER
Tatsuya Sato | Sciencx - » Labeling by GPT. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2023/05/21/labeling-by-gpt/
CHICAGO
" » Labeling by GPT." Tatsuya Sato | Sciencx - Accessed . https://www.scien.cx/2023/05/21/labeling-by-gpt/
IEEE
" » Labeling by GPT." Tatsuya Sato | Sciencx [Online]. Available: https://www.scien.cx/2023/05/21/labeling-by-gpt/. [Accessed: ]
rf:citation
» Labeling by GPT | Tatsuya Sato | Sciencx | https://www.scien.cx/2023/05/21/labeling-by-gpt/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.