-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0f97492
commit b2e6710
Showing
7 changed files
with
588 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Ignore macOS system files | ||
.DS_Store | ||
|
||
# Ignore environment variable files | ||
.env | ||
.env.* | ||
|
||
# Ignore build output directories | ||
build/ | ||
|
||
# Ignore Go debuger and generated files | ||
__debug_bin* | ||
*_generated.go | ||
*.generated.go | ||
|
||
.modusdb/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
# GitHub Issue Knowledge Base Generator (Modus + Hypermode) 🚀 | ||
|
||
This project automatically generates a Knowledge Base (KB) article when a GitHub issue is closed. It utilizes Hypermode and Modus (a serverless Go framework) to process issue data and generate a structured KB article using an LLM. The article is then posted as a GitHub Discussion. | ||
|
||
## 🛠 Features | ||
|
||
- Fetches GitHub issue details and comments upon issue closure. | ||
- Uses LLM (Hugging Face model via Hypermode) to generate a detailed KB article. | ||
- Posts the generated KB article as a GitHub Discussion. | ||
- Can be triggered manually or via GitHub Actions. | ||
|
||
-- | ||
|
||
## 🖥️ Running Locally | ||
|
||
### 1️⃣ Install Modus | ||
|
||
First, install Modus CLI: | ||
|
||
``` | ||
npm install -g @hypermodeinc/modus | ||
``` | ||
|
||
### 2️⃣ Clone the Repository | ||
|
||
``` | ||
git clone https://github.com/YOUR_USERNAME/YOUR_REPO.git | ||
cd YOUR_REPO | ||
``` | ||
|
||
### 3️⃣ Start the Modus Dev Server | ||
|
||
``` | ||
modus dev | ||
``` | ||
|
||
### 4️⃣ Test the API Locally | ||
|
||
Go to: | ||
|
||
``` | ||
http://localhost:54321/graphql | ||
``` | ||
|
||
You'll see an exported function `issueClosedHandler`. Test the KB Article Generation. Enter the repository name and issue number and run the query. The API will return a formatted KB article. You can also post the KB Article as a Discussion. To do so, pass a GitHub API token as well. | ||
|
||
-- | ||
|
||
## 🚀 Deploying to Hypermode | ||
|
||
To deploy the function to Hypermode: | ||
|
||
``` | ||
modus deploy | ||
``` | ||
|
||
Once deployed, copy your Hypermode endpoint, which will be used in the GitHub Action. | ||
|
||
-- | ||
|
||
## 🔧 Setting Up the GitHub Action | ||
|
||
This action allows the KB article to be generated automatically when an issue is closed. | ||
|
||
### 1️⃣ Clone the Project & Deploy to Hypermode | ||
|
||
If you haven't already: | ||
|
||
``` | ||
git clone https://github.com/YOUR_USERNAME/YOUR_REPO.git | ||
cd YOUR_REPO | ||
modus deploy | ||
``` | ||
|
||
Copy your Hypermode endpoint. | ||
|
||
### 2️⃣ Add the GitHub Action | ||
|
||
Copy the issue-summarizer.yml file into in your repository: | ||
|
||
### 3️⃣ Add Your Hypermode API Key to GitHub Secrets | ||
|
||
1. Go to your GitHub repository. | ||
2. Navigate to Settings → Secrets and variables → Actions. | ||
3. Click New repository secret. | ||
4. Name it: `HYPERMODE_API_KEY` | ||
5. Paste your Hypermode API key. | ||
6. Save. | ||
|
||
### 4️⃣ Done! 🎉 | ||
|
||
Now, every time a GitHub issue is closed, a KB article will be generated and posted as a GitHub Discussion. | ||
|
||
-- | ||
|
||
## 🛠 Troubleshooting | ||
|
||
GitHub Discussion Not Created? | ||
|
||
Ensure: | ||
|
||
- You have enabled Discussions under Repository Settings → Features. | ||
- Your GitHub token has the discussions: write permission. | ||
|
||
No Response from the API? | ||
|
||
- Check if your Modus function is deployed (modus deploy). | ||
- Verify that your Hypermode API key is correct in GitHub Secrets. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module modus-gh-issue-summarizer | ||
Check failure on line 1 in modus-gh-issue-summarizer/go.mod
|
||
|
||
go 1.23.3 | ||
|
||
toolchain go1.23.5 | ||
|
||
require github.com/hypermodeinc/modus/sdk/go v0.17.0 | ||
|
||
require ( | ||
github.com/tidwall/gjson v1.18.0 // indirect | ||
github.com/tidwall/match v1.1.1 // indirect | ||
github.com/tidwall/pretty v1.2.1 // indirect | ||
github.com/tidwall/sjson v1.2.5 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
github.com/hypermodeinc/modus/sdk/go v0.17.0 h1:vyS82iw31xuxqQKxiVtwrSNuF6hkMEJoynlcxthAeYM= | ||
github.com/hypermodeinc/modus/sdk/go v0.17.0/go.mod h1:UzVpTQDjloJuErOiNP3Tma3N8crE5qwYfKQyX1ecKlA= | ||
github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= | ||
github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY= | ||
github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= | ||
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= | ||
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= | ||
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= | ||
github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= | ||
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= | ||
github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= | ||
github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= |
Oops, something went wrong.