Skip to content

Commit 55bf172

Browse files
committed
feat(examples): move 1-month age check to native github-script step
1 parent 2b10d1f commit 55bf172

3 files changed

Lines changed: 22 additions & 8 deletions

File tree

examples/workflows/issue-cleanup/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ This document describes a workflow to batch-process and clean up older open issu
66

77
The Issue Cleanup workflow is designed to automate the triage of stale issues by using the Gemini CLI to:
88

9-
1. **Check for Staleness (Native)**: Identifies if an issue has been waiting for reporter feedback for over 7 days. If so, it closes the issue directly via a GitHub Action script to save AI resources.
10-
2. **Check for Age and Vagueness (AI)**: If an issue is not stale but hasn't been updated in over a month, it asks the reporter to reproduce the issue with the latest build. If the issue lacks sufficient information (e.g., reproduction steps), it asks the reporter for specific details and stops.
9+
1. **Check for Staleness and Age (Native)**: Identifies if an issue has been waiting for reporter feedback for over 7 days, closing it if so. If the issue is not stale but hasn't been updated in over a month, it asks the reporter to reproduce the issue with the latest build. This is handled via a native GitHub Action script to save AI resources.
10+
2. **Check for Vagueness (AI)**: If an issue is not stale or old but lacks sufficient information (e.g., reproduction steps), the agent asks the reporter for specific details and stops.
1111
3. **Check Code Validity (AI)**: Determines if an issue is still relevant against the current codebase. The agent may attempt to write and execute a minimal reproduction script to verify if a bug has been resolved, or manually inspect the code. If verified as fixed, it will close the issue with an explanation.
1212
4. **Find Duplicates (AI)**: Checks if the issue has a more recent duplicate. If a duplicate exists, it closes the issue and links to the duplicate.
1313
5. **Summarize for Triage (AI)**: If an issue is still valid and unique, it provides a summary comment based on customizable instructions (e.g., categorizing it as `Maintainer-only` or `Help-wanted`). If no custom instructions are provided, it falls back to a standard triage summary.

examples/workflows/issue-cleanup/gemini-issue-cleanup.toml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,13 @@ You are an automated triage bot for the `!{echo $REPOSITORY}` repository. Your j
88
99
## Task Lifecycle
1010
11-
### Step 1: Setup, Age & Vagueness Check
11+
### Step 1: Setup & Vagueness Check
1212
- Run `git clone https://github.com/!{echo $REPOSITORY}.git target-repo`
13-
- Run `gh issue view !{echo $ISSUE_NUMBER} --repo !{echo $REPOSITORY} --json title,body,author,comments,updatedAt`
14-
- **Age Check**: If the issue was last updated over 1 month ago (compare `updatedAt` to the current `date`):
15-
- Ask the reporter: `gh issue comment !{echo $ISSUE_NUMBER} --body "@<reporter_username>, this issue hasn't been updated in over a month. Could you please try reproducing it with the latest build and let us know if it still occurs? If so, please provide detailed reproduction steps." --repo !{echo $REPOSITORY}`
16-
- **STOP EXECUTION IMMEDIATELY**.
13+
- Run `gh issue view !{echo $ISSUE_NUMBER} --repo !{echo $REPOSITORY} --json title,body,author,comments`
1714
- **Vagueness Check**: If the issue description is fundamentally missing context (no logs, no repro steps, just "it's broken") AND no one has asked for more information yet:
1815
- Ask the reporter: `gh issue comment !{echo $ISSUE_NUMBER} --body "@<reporter_username>, thank you for the report! Could you please provide more specific details (e.g., reproduction steps, expected behavior, and environment)? Closing this as vague if no response is received in a week." --repo !{echo $REPOSITORY}`
1916
- **STOP EXECUTION IMMEDIATELY**.
20-
- If the issue is clear, recent, or the reporter has provided info, proceed to Step 2.
17+
- If the issue is clear or the reporter has provided info, proceed to Step 2.
2118
2219
### Step 2: Reproduction & Code Validity Check
2320
- If the issue describes a reproducible bug (e.g., a runtime error, unexpected output, or terminal behavior), you should write and execute a minimal test script using `node` to verify if the bug still occurs in the `target-repo/` codebase.

examples/workflows/issue-cleanup/gemini-issue-cleanup.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,23 @@ jobs:
125125
}
126126
}
127127
}
128+
129+
// Check overall issue age / inactivity
130+
const lastUpdateDaysAgo = (new Date() - new Date(issue.updated_at)) / (1000 * 60 * 60 * 24);
131+
console.log(`Issue was last updated ${lastUpdateDaysAgo.toFixed(1)} days ago.`);
132+
133+
if (lastUpdateDaysAgo > 30) {
134+
console.log(`Issue has been inactive for over a month. Asking for repro.`);
135+
await github.rest.issues.createComment({
136+
owner: context.repo.owner,
137+
repo: context.repo.repo,
138+
issue_number: issueNumber,
139+
body: `@${reporter}, this issue hasn't been updated in over a month. Could you please try reproducing it with the latest build and let us know if it still occurs? If so, please provide detailed reproduction steps.`
140+
});
141+
core.setOutput('is_stale', 'true');
142+
return;
143+
}
144+
128145
core.setOutput('is_stale', 'false');
129146
130147
- name: 'Checkout Current Repository'

0 commit comments

Comments
 (0)