Skip to content

Commit 0eedc99

Browse files
committed
fix(examples): apply PR review suggestions for issue cleanup workflow
1 parent 0d94b4b commit 0eedc99

3 files changed

Lines changed: 16 additions & 17 deletions

File tree

examples/workflows/issue-cleanup/README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@ The Issue Cleanup workflow is designed to automate the triage of stale issues by
1212

1313
## Usage
1414

15-
This example is tailored to process issues in a specific repository (`google-gemini/gemini-cli`) matching specific labels (`area/core`, `area/extensions`, `area/site`, `area/non-interactive`), selecting the 10 issues with the oldest last update time.
15+
This example is tailored to process issues in your repository matching specific labels (`area/core`, `area/extensions`, `area/site`, `area/non-interactive`), selecting the 10 issues with the oldest last update time.
1616

1717
To adapt this to your own repository:
1818

1919
1. Copy `gemini-issue-cleanup.yml` to your repository's `.github/workflows/` directory.
20-
2. Update the repository name and search string in the `Find old issues for cleanup` step in `gemini-issue-cleanup.yml`.
21-
3. Update the repository name in the `Checkout Target Repository Code` step in `gemini-issue-cleanup.yml`.
22-
4. Copy `gemini-issue-cleanup.toml` to your `.github/commands/` directory.
23-
5. Update the prompt instructions in `gemini-issue-cleanup.toml` replacing `google-gemini/gemini-cli` with your repository name.
20+
2. Update the search string in the `Find old issues for cleanup` step in `gemini-issue-cleanup.yml` to match your repository's labels.
21+
3. Copy `gemini-issue-cleanup.toml` to your `.github/commands/` directory.
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
description = "Analyzes and cleans up older issues by checking code validity, duplicates, and providing a triage summary."
22
prompt = """
33
## Role
4-
You are an expert AI triage assistant and repository maintainer for the `google-gemini/gemini-cli` repository.
4+
You are an expert AI triage assistant and repository maintainer for the `!{echo $REPOSITORY}` repository.
55
66
## Critical Constraints
77
1. **Focus on the Target Issue**: DO NOT investigate the workflow files, `.github/commands/`, or how this tool is configured.
8-
2. **Clone the Target Repository**: Because this workflow runs independently, the target repository (`google-gemini/gemini-cli`) is NOT automatically present in the workspace. You MUST explicitly clone it (e.g., `git clone https://github.com/google-gemini/gemini-cli.git target-repo`) before beginning your investigation in Step 1.
8+
2. **Clone the Target Repository**: Because this workflow runs independently, the target repository (`!{echo $REPOSITORY}`) is NOT automatically present in the workspace. You MUST explicitly clone it (e.g., `git clone https://github.com/!{echo $REPOSITORY}.git target-repo`) before beginning your investigation in Step 1.
99
3. **Efficiency**: Use your search tools (`grep_search`, `read_file`) quickly against the cloned repository. If you cannot definitively determine if an issue is still valid after a short investigation (e.g., within a few turns), proceed immediately to Step 2 and Step 3 (categorizing it as `Maintainer-only`). DO NOT spend excessive turns exploring the codebase.
1010
1111
## Task
12-
Your task is to analyze GitHub Issue #!{echo $ISSUE_NUMBER} in `google-gemini/gemini-cli` and sequentially perform three specific checks.
12+
Your task is to analyze GitHub Issue #!{echo $ISSUE_NUMBER} in `!{echo $REPOSITORY}` and sequentially perform three specific checks.
1313
You MUST use your tools (like `grep_search`, `read_file`, and `run_shell_command(gh)`) to investigate the codebase and issue tracker. Do NOT guess or hallucinate.
1414
1515
### Step 1: Check Code Validity
16-
- Use `gh issue view !{echo $ISSUE_NUMBER} --repo google-gemini/gemini-cli --json title,body,state,comments` to read the issue details.
16+
- Use `gh issue view !{echo $ISSUE_NUMBER} --repo !{echo $REPOSITORY} --json title,body,state,comments` to read the issue details.
1717
- Search the local workspace to determine if the issue is still valid.
1818
- For example, if it's a bug, does the buggy code still exist? If it's a feature request, has it already been implemented?
1919
- If you definitively determine the issue is NO LONGER VALID:
2020
- Close the issue and leave a brief comment explaining why (e.g., "Closing because this appears to have been fixed in the latest codebase. <explanation>").
21-
- Use `gh issue close !{echo $ISSUE_NUMBER} --comment "Closing because this appears to have been fixed in the latest codebase. <explanation>" --repo google-gemini/gemini-cli`
21+
- Use `gh issue close !{echo $ISSUE_NUMBER} --comment "Closing because this appears to have been fixed in the latest codebase. <explanation>" --repo !{echo $REPOSITORY}`
2222
- STOP execution. You are done with this issue.
2323
2424
### Step 2: Check for Duplicates
2525
- If the issue is still valid, check if it's a duplicate of another issue that is already being tracked or worked on.
26-
- Use `gh issue list --search "<keywords>" --repo google-gemini/gemini-cli --state all` with relevant keywords to find potential duplicates.
26+
- Use `gh issue list --search "<keywords>" --repo !{echo $REPOSITORY} --state all` with relevant keywords to find potential duplicates.
2727
- If you find a clear duplicate that someone is working on or has already resolved:
2828
- Close the issue as not planned, pointing to the duplicate.
29-
- Use `gh issue close !{echo $ISSUE_NUMBER} --reason "not planned" --comment "Closing as duplicate of #<duplicate_number>." --repo google-gemini/gemini-cli`
29+
- Use `gh issue close !{echo $ISSUE_NUMBER} --reason "not planned" --comment "Closing as duplicate of #<duplicate_number>." --repo !{echo $REPOSITORY}`
3030
- STOP execution. You are done with this issue.
3131
3232
### Step 3: Provide Triage Summary
@@ -35,6 +35,6 @@ You MUST use your tools (like `grep_search`, `read_file`, and `run_shell_command
3535
- **Maintainer-only**: (e.g., epic, core architecture, sensitive fixes, internal tasks, or issues requiring deep investigation)
3636
- **Help-wanted**: (e.g., good for community, general bugs, features, or tasks ready for external help)
3737
- Your comment should be brief and clearly explain *why* it fits that category.
38-
- Use `gh issue comment !{echo $ISSUE_NUMBER} --body "### Triage Summary\n\n**Category:** <Maintainer-only OR Help-wanted>\n\n**Reasoning:** <brief explanation>" --repo google-gemini/gemini-cli`
38+
- Use `gh issue comment !{echo $ISSUE_NUMBER} --body "### Triage Summary\n\n**Category:** <Maintainer-only OR Help-wanted>\n\n**Reasoning:** <brief explanation>" --repo !{echo $REPOSITORY}`
3939
- STOP execution. You are done with this issue.
4040
"""

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ jobs:
2525
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN || github.token }}'
2626
run: |-
2727
echo '🔍 Finding old issues for cleanup...'
28-
# Query matches target: google-gemini/gemini-cli, open issues, sorted by oldest last update time
28+
# Query matches target repository, open issues, sorted by oldest last update time
2929
# with labels area/core, area/extensions, area/site, area/non-interactive
3030
ISSUES="$(gh issue list \
31-
--repo google-gemini/gemini-cli \
31+
--repo ${{ github.repository }} \
3232
--state 'open' \
3333
--search "label:area/core,area/extensions,area/site,area/non-interactive sort:updated-asc" \
3434
--json number \
3535
--limit 10 \
3636
)"
3737
38-
# Convert to JSON array of integers
39-
ISSUE_NUMBERS="$(echo "${ISSUES}" | jq -c '[.[].number | tostring]')"
38+
# Convert to JSON array
39+
ISSUE_NUMBERS="$(echo "${ISSUES}" | jq -c '[.[].number]')"
4040
4141
if [ "${ISSUE_NUMBERS}" = "[]" ] || [ -z "${ISSUE_NUMBERS}" ]; then
4242
echo "issue_numbers=[]" >> "${GITHUB_OUTPUT}"
@@ -68,6 +68,7 @@ jobs:
6868
uses: 'google-github-actions/run-gemini-cli@v0' # Replace with actual version when deploying
6969
env:
7070
ISSUE_NUMBER: '${{ matrix.issue_number }}'
71+
REPOSITORY: '${{ github.repository }}'
7172
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN || github.token }}'
7273
with:
7374
# Modify the auth settings depending on your environment

0 commit comments

Comments
 (0)