Skip to content

Continuous Issue Triage #21

Continuous Issue Triage

Continuous Issue Triage #21

name: "Continuous Issue Triage"
on:
schedule:
- cron: "0 8 * * *" # Run daily at 8 AM UTC
workflow_dispatch:
inputs:
limit:
description: "Number of issues to triage"
required: false
default: "10"
permissions:
contents: read
issues: read
pull-requests: read
jobs:
triage-issues:
name: "Triage Open Issues"
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
- name: Get open issues
id: issues
run: |
LIMIT="${{ github.event.inputs.limit || '10' }}"
echo "limit=$LIMIT" >> $GITHUB_OUTPUT
gh issue list \
--state open \
--limit "$LIMIT" \
--json number,title,labels,createdAt \
--jq '.[] | "#\(.number): \(.title)\nLabels: \(.labels | map(.name) | join(", "))\nCreated: \(.createdAt)\n---"'
- name: Run Triage Analysis
uses: google-github-actions/run-gemini-cli@v0.1.21
with:
gemini_api_key: ${{ secrets.GEMINI_API_KEY }}
prompt: |
You are an expert issue triage assistant. Analyze these open issues and provide insights.
## Open Issues
${{ steps.issues.outputs.issues }}
## Your Task
For each issue, suggest:
1. Appropriate labels based on content
2. Priority level (if not already set)
3. Whether it's a good candidate for automation/AI implementation
4. Any duplicate or related issues
Also provide:
- A summary of the most urgent issues
- Suggested sprint/roadmap priorities
- Issues that could be closed as duplicates or invalid
Format your response clearly with sections for each category.
gemini_model: gemini-2.5-flash-lite
gemini_debug: ${{ vars.GEMINI_DEBUG == 'true' }}
- name: Create triage report
if: always()
run: |
SUMMARY="${{ steps.gemini.outputs.summary }}"
gh issue create \
--title "Daily Triage Report - $(date +'%Y-%m-%d')" \
--body "$SUMMARY" \
--label "triage-report,automated"
- name: Apply suggested labels
if: always()
run: |
# This is a dry run - labels should be reviewed before applying
echo "Review the triage report for suggested label changes"
# Example of how to apply labels (commented out for safety)
# gh issue edit 123 --add-label "priority: high"
stale-issue-check:
name: "Identify Stale Issues"
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Find stale issues
run: |
STALE_ISSUES=$(gh issue list \
--state open \
--search "no:label updated:<2024-01-01" \
--limit 20 \
--json number,title,updatedAt \
--jq '.[] | "- [#\(.number)](\(.html_url)): \(.title) (updated: \(.updatedAt))"')
if [ -n "$STALE_ISSUES" ]; then
echo "## Stale Issues Found" >> stale-issues.md
echo "$STALE_ISSUES" >> stale-issues.md
gh issue create \
--title "Stale Issues Review - $(date +'%Y-%m-%d')" \
--body "$(cat stale-issues.md)" \
--label "stale,needs-attention,automated"
else
echo "No stale issues found"
fi