|
| 1 | +# GitHub Issue Automation Workflows |
| 2 | + |
| 3 | +This directory contains automated workflows for managing GitHub issues using AWS Bedrock AI. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +The automation system provides: |
| 8 | +- **Automatic Label Assignment** - AI-powered classification of issues |
| 9 | +- **Duplicate Detection** - Semantic similarity analysis to find duplicate issues |
| 10 | +- **Duplicate Closure** - Automatic closure of confirmed duplicates after 3 days |
| 11 | +- **Stale Issue Management** - Closure of inactive issues after 7 days |
| 12 | + |
| 13 | +## Workflows |
| 14 | + |
| 15 | +### 1. Issue Triage (`issue-triage.yml`) |
| 16 | + |
| 17 | +**Trigger:** When a new issue is opened |
| 18 | + |
| 19 | +**What it does:** |
| 20 | +1. Analyzes the issue title and body using AWS Bedrock Claude Sonnet 4.5 |
| 21 | +2. Assigns relevant labels from the predefined taxonomy |
| 22 | +3. Detects potential duplicate issues |
| 23 | +4. Posts a comment if duplicates are found |
| 24 | +5. Adds the "duplicate" label if applicable |
| 25 | + |
| 26 | +**Required Secrets:** |
| 27 | +- `AWS_ACCESS_KEY_ID` - AWS access key with Bedrock permissions |
| 28 | +- `AWS_SECRET_ACCESS_KEY` - AWS secret access key |
| 29 | +- `AWS_REGION` (optional) - AWS region, defaults to us-east-1 |
| 30 | +- `GITHUB_TOKEN` - Automatically provided by GitHub Actions |
| 31 | + |
| 32 | +### 2. Close Duplicates (`close-duplicates.yml`) |
| 33 | + |
| 34 | +**Trigger:** Daily at midnight UTC (or manual) |
| 35 | + |
| 36 | +**What it does:** |
| 37 | +1. Finds all open issues with the "duplicate" label |
| 38 | +2. Checks how long the label has been applied |
| 39 | +3. Closes issues where the label has been present for 3+ days |
| 40 | +4. Posts a closing comment with reference to the original issue |
| 41 | + |
| 42 | +**Manual Trigger:** |
| 43 | +```bash |
| 44 | +gh workflow run close-duplicates.yml |
| 45 | +``` |
| 46 | + |
| 47 | +### 3. Close Stale Issues (`close-stale.yml`) |
| 48 | + |
| 49 | +**Trigger:** Daily at midnight UTC (or manual) |
| 50 | + |
| 51 | +**What it does:** |
| 52 | +1. Finds all open issues with the "pending-response" label |
| 53 | +2. Checks the last activity date (comments or label changes) |
| 54 | +3. Closes issues with no activity for 7+ days |
| 55 | +4. Posts a closing comment explaining the inactivity |
| 56 | + |
| 57 | +**Manual Trigger:** |
| 58 | +```bash |
| 59 | +gh workflow run close-stale.yml |
| 60 | +``` |
| 61 | + |
| 62 | +## Setup Instructions |
| 63 | + |
| 64 | +### 1. AWS Bedrock Access |
| 65 | + |
| 66 | +Ensure you have access to AWS Bedrock with the Claude Sonnet 4.5 model: |
| 67 | + |
| 68 | +1. Enable Bedrock in your AWS account |
| 69 | +2. Request access to the Claude Sonnet 4 model |
| 70 | +3. Create an IAM user with the following permissions: |
| 71 | + |
| 72 | +```json |
| 73 | +{ |
| 74 | + "Version": "2012-10-17", |
| 75 | + "Statement": [ |
| 76 | + { |
| 77 | + "Effect": "Allow", |
| 78 | + "Action": [ |
| 79 | + "bedrock:InvokeModel" |
| 80 | + ], |
| 81 | + "Resource": "arn:aws:bedrock:*::foundation-model/anthropic.claude-sonnet-4-*" |
| 82 | + } |
| 83 | + ] |
| 84 | +} |
| 85 | +``` |
| 86 | + |
| 87 | +**Note:** The system uses inference profile ID `us.anthropic.claude-sonnet-4-20250514-v1:0` for cross-region routing and higher throughput. |
| 88 | + |
| 89 | +### 2. GitHub Secrets |
| 90 | + |
| 91 | +Add the following secrets to your repository: |
| 92 | + |
| 93 | +1. Go to Settings → Secrets and variables → Actions |
| 94 | +2. Add the following secrets: |
| 95 | + - `AWS_ACCESS_KEY_ID` - Your AWS access key ID |
| 96 | + - `AWS_SECRET_ACCESS_KEY` - Your AWS secret access key |
| 97 | + - (Optional) `AWS_REGION` - AWS region, defaults to us-east-1 |
| 98 | + |
| 99 | +### 3. Labels |
| 100 | + |
| 101 | +Create the following labels in your repository: |
| 102 | + |
| 103 | +**Feature/Component Labels:** |
| 104 | +- auth, autocomplete, chat, cli, extensions, hooks, ide, mcp, models, powers, specs, ssh, steering, sub-agents, terminal, ui, usability, trusted-commands, pricing, documentation, dependencies, compaction |
| 105 | + |
| 106 | +**OS-Specific Labels:** |
| 107 | +- os: linux, os: mac, os: windows |
| 108 | + |
| 109 | +**Theme Labels:** |
| 110 | +- theme:account, theme:agent-latency, theme:agent-quality, theme:context-limit-issue, theme:ide-performance, theme:slow-unresponsive, theme:ssh-wsl, theme:unexpected-error |
| 111 | + |
| 112 | +**Workflow Labels:** |
| 113 | +- pending-maintainer-response, pending-response, pending-triage, duplicate, question |
| 114 | + |
| 115 | +**Special Labels:** |
| 116 | +- Autonomous agent, Inline chat, on boarding |
| 117 | + |
| 118 | +You can create labels manually or use the GitHub CLI: |
| 119 | + |
| 120 | +```bash |
| 121 | +gh label create "pending-triage" --color "fbca04" --description "Awaiting maintainer review" |
| 122 | +gh label create "duplicate" --color "cfd3d7" --description "This issue is a duplicate" |
| 123 | +gh label create "pending-response" --color "d4c5f9" --description "Awaiting response from issue author" |
| 124 | +# ... add more labels as needed |
| 125 | +``` |
| 126 | + |
| 127 | +### 4. Install Dependencies |
| 128 | + |
| 129 | +The workflows automatically install dependencies, but for local development: |
| 130 | + |
| 131 | +```bash |
| 132 | +cd scripts |
| 133 | +npm install |
| 134 | +npm run build |
| 135 | +``` |
| 136 | + |
| 137 | +## Troubleshooting |
| 138 | + |
| 139 | +### Workflow Fails with AWS Authentication Error |
| 140 | + |
| 141 | +**Problem:** `UnrecognizedClientException` or authentication errors |
| 142 | + |
| 143 | +**Solution:** |
| 144 | +1. Verify AWS credentials are correctly set in GitHub Secrets |
| 145 | +2. Ensure the IAM user has Bedrock permissions |
| 146 | +3. Check that the AWS region is correct |
| 147 | + |
| 148 | +### No Labels Are Applied |
| 149 | + |
| 150 | +**Problem:** Issues are created but no labels are added |
| 151 | + |
| 152 | +**Solution:** |
| 153 | +1. Check the workflow run logs for errors |
| 154 | +2. Verify the labels exist in the repository |
| 155 | +3. Ensure the Bedrock API is responding correctly |
| 156 | + |
| 157 | +### Duplicate Detection Not Working |
| 158 | + |
| 159 | +**Problem:** Duplicates are not being detected |
| 160 | + |
| 161 | +**Solution:** |
| 162 | +1. Check that there are existing open issues to compare against |
| 163 | +2. Verify AWS Bedrock access is working |
| 164 | +3. Review the similarity threshold (currently 0.80) |
| 165 | + |
| 166 | +### Rate Limiting Issues |
| 167 | + |
| 168 | +**Problem:** Workflows fail due to GitHub API rate limits |
| 169 | + |
| 170 | +**Solution:** |
| 171 | +1. The workflows include rate limit handling |
| 172 | +2. For high-volume repositories, consider adjusting batch sizes |
| 173 | +3. Check the rate limit status: `gh api rate_limit` |
| 174 | + |
| 175 | +## Monitoring |
| 176 | + |
| 177 | +### Workflow Run Summaries |
| 178 | + |
| 179 | +Each workflow generates a summary visible in the Actions tab: |
| 180 | +- Total issues processed |
| 181 | +- Success/failure counts |
| 182 | +- Detailed error information |
| 183 | + |
| 184 | +### Logs |
| 185 | + |
| 186 | +View detailed logs for each workflow run: |
| 187 | +1. Go to Actions tab |
| 188 | +2. Select the workflow |
| 189 | +3. Click on a specific run |
| 190 | +4. Expand the steps to see detailed logs |
| 191 | + |
| 192 | +## Customization |
| 193 | + |
| 194 | +### Adjusting Thresholds |
| 195 | + |
| 196 | +Edit the TypeScript files in `scripts/`: |
| 197 | + |
| 198 | +**Duplicate closure threshold (default: 3 days):** |
| 199 | +```typescript |
| 200 | +// In close_duplicates.ts |
| 201 | +const DAYS_THRESHOLD = 3; |
| 202 | +``` |
| 203 | + |
| 204 | +**Stale issue threshold (default: 7 days):** |
| 205 | +```typescript |
| 206 | +// In close_stale.ts |
| 207 | +const DAYS_THRESHOLD = 7; |
| 208 | +``` |
| 209 | + |
| 210 | +**Duplicate similarity threshold (default: 0.80):** |
| 211 | +```typescript |
| 212 | +// In detect_duplicates.ts |
| 213 | +const SIMILARITY_THRESHOLD = 0.8; |
| 214 | +``` |
| 215 | + |
| 216 | +### Modifying Schedules |
| 217 | + |
| 218 | +Edit the cron expressions in the workflow files: |
| 219 | + |
| 220 | +```yaml |
| 221 | +on: |
| 222 | + schedule: |
| 223 | + - cron: "0 0 * * *" # Daily at midnight UTC |
| 224 | +``` |
| 225 | +
|
| 226 | +## Support |
| 227 | +
|
| 228 | +For issues or questions: |
| 229 | +1. Check the workflow run logs |
| 230 | +2. Review the troubleshooting section |
| 231 | +3. Open an issue in the repository |
0 commit comments