Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maurerkrisztian/issue-improver-action
GitHub Action that automates issue improvement suggestions using OpenAI GPT.
https://github.com/maurerkrisztian/issue-improver-action
actions ai github-actions issue-management
Last synced: 3 days ago
JSON representation
GitHub Action that automates issue improvement suggestions using OpenAI GPT.
- Host: GitHub
- URL: https://github.com/maurerkrisztian/issue-improver-action
- Owner: MaurerKrisztian
- License: mit
- Created: 2023-04-25T19:35:18.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-15T18:32:42.000Z (9 months ago)
- Last Synced: 2024-02-15T19:24:41.907Z (9 months ago)
- Topics: actions, ai, github-actions, issue-management
- Language: TypeScript
- Homepage: https://github.com/marketplace/actions/clarify-and-improve-issues-with-openai-gpt
- Size: 50.1 MB
- Stars: 4
- Watchers: 2
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# issue-improver-action
![Maurer Krisztian](https://user-images.githubusercontent.com/48491140/234571713-eb6a3708-40b5-4b81-903d-7c4d0b16ccea.png)
GitHub Action that automates issue improvement suggestions using OpenAI.
## Inputs:
| Input | Required | Default | Info |
|----------------------------|----------|-------------------------|------------------------------------------------------------------------|
| openai-key | Yes | N/A | OpenAI API key |
| config-file | No | issue-improver-config.json | Configuration file |
| add-related-issues-section | No | false | Create a related issues section. |
| add-summary-section | No | false | Create a summary section. |
| add-comment-summary-section | No | false | Create comment summary |
| add-custom-section | No | N/A | custom section title/id comma separated string. "*" means include all. |
| add-label-section | No | false | Create label suggesion |
| model | No | gpt-4 | OpenAI model |
| max-tokens | No | 150 | OpenAI max_tokens (response length) |
| debug-mode | No | false | Enable debug mode: Don't create comment |## How does It work?
This action can be triggered to gather the relevant issue data, make usefully comments with GPT model.
One of the main building blocs is the "sections" every section has at lease a title and prompt parameter,
you can specify which section do you need at the action workflow yml. When the action runs, resolves all selected sections prompts with Openapi GPT model.
The prompts has default values (see: `src/config/default-config.ts`) but you can fully customize all of them and create custom sections.
The resulting responses will then be added as a comment to the issue.## Try it out here: [Demo repository](https://github.com/MaurerKrisztian/issue-improver-action-demo)
## Built in sections:
### related-issues-section
Find related issues among open issues.I have noticed that many open-source projects have few maintainers and a lot of issues.
Some issues are duplicates, while others are related to each other. These details are useful to the maintainer.
With the assistance of AI, this action will create a "related issues" section in the comment.### label-section
Find relevant labels for the issue.The action will get all the labels and descriptions and issue data, based on that create a label suggession.
### summary-section
Summarize the issue text.### custom-section
add custom sections to the `sections.custom` array within the configuration file.### comment-summary-section
Summarize all comment at the current issue, make progress report etc.Occasionally, certain GitHub issues can be overwhelming with an abundance of comments, making it difficult to comprehend the situation. To address this, I have developed a comment summary feature.
## debug mode
If you turn on debug mode, it will do the following: resolve prompts, give you more detailed logs of what's happening, and not create comment.. To enable this, set the `debug-mode` input to `true`.If you want to test an action without making changes to any issues, it's useful to turn on debug mode. This will allow you to view the logs and see what comment would be created if debug mode was turned off. Once you're satisfied with the results, you can turn off debug mode.
## Action example:
This action will trigger when new issue is opened,
and creates a comment including: related-issues-section, summary-section, label-section, custom-section```yml
name: Improve issueson:
issues:
types: [opened]jobs:
gpt-comment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create useful comment with AI
uses: MaurerKrisztian/issue-improver-action@latest
with:
openai-key: ${{ secrets.GPT_KEY }}
max-tokens: 400
add-related-issues-section: true
add-summary-section: true
add-label-section: true
add-custom-section: "my_custom_section1,my_custom_section2"
```## Comment Summary
The YAML code below demonstrates how to activate comment summary, progress report, using the "!summarize" command.```yml
on:
issue_comment:jobs:
comment-summary:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Comment summary
uses: MaurerKrisztian/issue-improver-action@latest
if: contains(github.event.comment.body, '!summarize')
with:
openai-key: ${{ secrets.GPT_KEY }}
max-tokens: 400
add-comment-summary-section: true
```## Custom section:
All section prompts is fully customisable.
To create custom sections / prompts, simply create a JSON file (location is the `config-file` input) and modify the prompts and section titles as desired. This will owerwite the default config (see: `src/config/default-config.ts`).Additionally, you can add new custom sections to the `sections.custom` array within the configuration file.
#### Example config:
```json
{
"systemMessage": "You are an experienced software developer tasked with analyzing GitHub issues. Your role involves offering insightful feedback in response to these requests.",
"sections": {
"custom": [
{
"title": "Joke",
"prompt": "make a joke about this: {{issueTitle}}"
},
{
"title": "Poem",
"prompt": "Write a short poem about this: {{issueTitle}}"
}
],
"relatedIssues": {
"title": "Related Issues",
"prompt": "From the list of open issues: {{openIssues}}, identify the most relevant ones related to '{{issueTitle}}' and provide a brief description of their similarities. Just the very simmilar related issues to '{{issueTitle}}' shoud be included in the answer, if none is very similar, andwer with 'none',"
},
"summary": {
"title": "Summary",
"prompt": "Provide a concise summary of the main points and objectives presented in the issue '{{issueTitle}}' and its content: {{issueBody}}."
},
"commentSummary": {
"title": "Comment summary",
"prompt": "Review the comments in {{issueComments}} for the issue '{{issueTitle}}' and its content: {{issueBody}}. Extract the key takeaways, notable updates, and any consensus reached, and provide a concise summary of the discussion."
},
"labelSuggestion": {
"title": "Label Suggestion",
"prompt": "Analyze the issue '{{issueTitle}}' and its content: {{issueBody}}, and suggest appropriate labels from the available labels {{allLabels}} that accurately represent the topic, scope, and complexity of the issue. The response shoud only include a label and why its suitable."
}
}
}
```
## Available placeholders:| Name | Description |
|----------------|----------------------------------------|
| `{{issueTitle}}` | The issue title |
| `{{issueBody}}` | The issue body |
| `{{issueComments}}` | All issue comment |
| `{{issueAuthor}}` | Issue creator |
| `{{allLabels}}` | All available labels in the repository |
| `{{openIssues}}` | All open issues in the repository |If you need a different placeholder, open an issue.
## Demo:
![Unable to submit form on mobile devices](https://user-images.githubusercontent.com/48491140/236701094-1d46c2bc-1d6c-4335-a0b9-27daf0688841.png)