Skip to content

Commit 6cee6e8

Browse files
committed
feat(examples): support explicit maintainers input for staleness check
1 parent 225eca7 commit 6cee6e8

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

examples/workflows/issue-cleanup/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ To adapt this to your own repository:
2020

2121
1. Copy `gemini-issue-cleanup.yml` to your repository's `.github/workflows/` directory.
2222
2. Update the search string in the `Find old issues for cleanup` step in `gemini-issue-cleanup.yml` to match your repository's labels.
23-
3. Copy `gemini-issue-cleanup.toml` to your `.github/commands/` directory.
23+
3. Configure the `maintainers` input in `gemini-issue-cleanup.yml` (either via the workflow dispatch inputs or by setting the `MAINTAINERS` repository variable) to explicitly list which users count as maintainers for the staleness check.
24+
4. Copy `gemini-issue-cleanup.toml` to your `.github/commands/` directory.

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ on:
44
schedule:
55
- cron: '0 0 * * 0' # Runs weekly at midnight on Sunday
66
workflow_dispatch:
7+
inputs:
8+
maintainers:
9+
description: 'Comma-separated list of maintainer usernames (e.g., gemini-cli)'
10+
required: false
11+
default: 'gemini-cli'
712

813
concurrency:
914
group: '${{ github.workflow }}'
@@ -66,11 +71,14 @@ jobs:
6671
uses: 'actions/github-script@v7'
6772
env:
6873
ISSUE_NUMBER: '${{ matrix.issue_number }}'
74+
MAINTAINERS: "${{ inputs.maintainers || vars.MAINTAINERS || ' }}"
6975
with:
7076
script: |-
7177
const issueNumber = parseInt(process.env.ISSUE_NUMBER, 10);
7278
console.log(`Checking staleness for issue #${issueNumber}`);
7379
80+
const maintainers = process.env.MAINTAINERS ? process.env.MAINTAINERS.split(',').map(m => m.trim()) : [];
81+
7482
const { data: issue } = await github.rest.issues.get({
7583
owner: context.repo.owner,
7684
repo: context.repo.repo,
@@ -85,8 +93,11 @@ jobs:
8593
});
8694
8795
// Find last maintainer comment
88-
const maintainerComments = comments.filter(c => c.user.login !== reporter && !c.user.login.includes('github-actions') && c.user.type !== 'Bot');
89-
96+
const maintainerComments = comments.filter(c => {
97+
if (c.user.login === reporter) return false;
98+
if (maintainers.length > 0) return maintainers.includes(c.user.login);
99+
return !c.user.login.includes('github-actions') && c.user.type !== 'Bot';
100+
});
90101
if (maintainerComments.length > 0) {
91102
const lastMaintainerComment = maintainerComments[maintainerComments.length - 1];
92103
const reporterReplied = comments.some(c => c.user.login === reporter && new Date(c.created_at) > new Date(lastMaintainerComment.created_at));

0 commit comments

Comments
 (0)