The ChatGPT Auto Labeler Action is a GitHub Action that automatically assigns labels to issues, discussions, and pull requests based on responses generated by ChatGPT. This action utilizes the power of ChatGPT to analyze the content and title of these artifacts and suggests suitable labels from the available labels.
![image](https://private-user-images.githubusercontent.com/100182843/287069608-7c9ea963-e0e5-4aa4-bb0d-b863b4050d0f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk3MDc4MzYsIm5iZiI6MTczOTcwNzUzNiwicGF0aCI6Ii8xMDAxODI4NDMvMjg3MDY5NjA4LTdjOWVhOTYzLWUwZTUtNGFhNC1iYjBkLWI4NjNiNDA1MGQwZi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNlQxMjA1MzZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zN2Q0YTM5NTY3N2FiODJiMTAxOTg0YWI2YTRmYWQ4OGNkMmJlMTgzMDgxNTVhZjJiMDBlZTM3ZGQ1NmRmYTM3JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.7tmaAmo1SAMFD63rRHZg-_VJ2-rTF6jfs4ewZOMZF64)
To use this action, you need to set up the necessary inputs and provide your ChatGPT API token.
Name | Description | Default |
---|---|---|
openai-api-key |
API token for ChatGPT. | Required |
gpt-model |
The ChatGPT model used. See available models here. | "gpt-3.5-turbo" |
gh-token |
GitHub personal access token. | |
timeout |
Timeout in seconds. | 60 |
details |
Additional details for label suggestions. For example: SBOM is not misconfig. | |
excluded-labels |
A comma-separated list of labels to exclude from automatic assignment. |
Create a workflow file (e.g., .github/workflows/auto-labeling.yaml
) with the following content:
name: Auto Labeling
on:
issues:
types:
- opened
pull_request:
types:
- opened
jobs:
auto-label:
runs-on: ubuntu-latest
steps:
- name: Auto Labeling with ChatGPT
uses: nikpivkin/auto-label@v0
with:
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
gh-token: ${{ secrets.MY_PERSONAL_GH_TOKEN }}
excluded-labels: "duplicate"
# Add additional steps as needed
ChatGPT API Token: Obtain a ChatGPT API token from the ChatGPT OpenAI API.
Workflow Trigger: Configure the workflow trigger as needed. The example above triggers the workflow when a new issue or pull request is opened.
This project is licensed under the MIT License.