@@ -21,27 +21,39 @@ jobs:
21
21
app-id : ${{ secrets.APP_ID }}
22
22
private-key : ${{ secrets.PRIVATE_KEY }}
23
23
24
- - name : Checkout repository
25
- uses : actions/checkout@v4
26
- with :
27
- token : ${{ steps.generate_token.outputs.token }}
24
+ - name : Authenticate GitHub CLI
25
+ run : |
26
+ echo "$GITHUB_TOKEN" | gh auth login --with-token
27
+ env :
28
+ GITHUB_TOKEN : ${{ steps.generate_token.outputs.token }}
28
29
29
30
- name : Find untriaged issues
30
31
id : find_issues
31
32
env :
32
33
GITHUB_TOKEN : ${{ steps.generate_token.outputs.token }}
33
34
run : |
35
+ echo "🔍 Finding issues without labels..."
34
36
NO_LABEL_ISSUES=$(gh issue list --repo ${{ github.repository }} --search "is:open is:issue no:label" --json number,title,body)
37
+
38
+ echo "🏷️ Finding issues that need triage..."
35
39
NEEDS_TRIAGE_ISSUES=$(gh issue list --repo ${{ github.repository }} --search "is:open is:issue label:\"status/needs-triage\"" --json number,title,body)
40
+
41
+ echo "🔄 Merging and deduplicating issues..."
36
42
ISSUES=$(echo "$NO_LABEL_ISSUES" "$NEEDS_TRIAGE_ISSUES" | jq -c -s 'add | unique_by(.number)')
43
+
44
+ echo "📝 Setting output for GitHub Actions..."
37
45
echo "issues_to_triage=$ISSUES" >> "$GITHUB_OUTPUT"
46
+
47
+ echo "💾 Writing issues to temporary file for Gemini CLI..."
48
+ echo "$ISSUES" > /tmp/issues_to_triage.json
49
+
50
+ echo "✅ Found $(echo "$ISSUES" | jq 'length') issues to triage! 🎯"
38
51
39
52
- name : Run Gemini Issue Triage
40
53
if : steps.find_issues.outputs.issues_to_triage != '[]'
41
- uses : google-gemini/gemini-cli-action@111dadaecabd309baba60f56f2b520c52c0f9a47
54
+ uses : google-gemini/gemini-cli-action@41c0f1b3cbd1a0b284251bd1aac034edd07a3a2f
42
55
env :
43
56
GITHUB_TOKEN : ${{ steps.generate_token.outputs.token }}
44
- ISSUES_TO_TRIAGE : ${{ steps.find_issues.outputs.issues_to_triage }}
45
57
REPOSITORY : ${{ github.repository }}
46
58
with :
47
59
version : 0.1.8-rc.0
@@ -54,19 +66,27 @@ jobs:
54
66
"coreTools": [
55
67
"run_shell_command(gh label list)",
56
68
"run_shell_command(gh issue edit)",
57
- "run_shell_command(gh issue list)"
58
- ],
69
+ "run_shell_command(gh issue list)",
70
+ "run_shell_command(cat /tmp/issues_to_triage.json)"
71
+ ]
59
72
}
60
73
prompt : |
61
74
You are an issue triage assistant. Analyze issues and apply appropriate labels.
62
75
63
76
Steps:
64
- 1. Run: `gh label list --limit 100`
65
- 2. Check environment variable: $ISSUES_TO_TRIAGE (JSON array of issues)
66
- 3. For each issue, apply labels: `gh issue edit ISSUE_NUMBER --add-label "label1,label2"`
77
+ 1. Run: `gh label list --limit 100` to see available labels
78
+ 2. Run: `cat /tmp/issues_to_triage.json` to get the issues that need triaging
79
+ 3. Parse the JSON array from step 2 and for each issue, apply appropriate labels using : `gh issue edit ISSUE_NUMBER --add-label "label1,label2"`
67
80
68
81
Guidelines:
69
- - Only use existing repository labels
70
- - Do not add comments
71
- - Triage each issue independently
72
- - Focus on: kind/*, area/*, priority/* labels
82
+ - Only use existing repository labels from step 1
83
+ - Do not add comments to issues
84
+ - Triage each issue independently based on title and body content
85
+ - Focus on applying: kind/* (bug/enhancement/documentation), area/* (core/cli/testing/windows), and priority/* labels
86
+ - If an issue has insufficient information, consider applying "status/need-information"
87
+
88
+ Example triage logic:
89
+ - Issues with "bug", "error", "broken" → kind/bug
90
+ - Issues with "feature", "enhancement", "improve" → kind/enhancement
91
+ - Issues about Windows/performance → area/windows, area/performance
92
+ - Critical bugs → priority/p0, other bugs → priority/p1, enhancements → priority/p2
0 commit comments