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.
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.
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.
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:
Next, I implemented and test it on its repository.
This is quite simple and easy: define a YAML file under .github/workflows.
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.