mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-15 06:12:50 -07:00
🤖 Gemini Bot Productivity Optimizations
This commit is contained in:
@@ -21,8 +21,8 @@ permissions:
|
||||
|
||||
jobs:
|
||||
manage-lifecycle:
|
||||
if: github.repository == 'google-gemini/gemini-cli'
|
||||
runs-on: ubuntu-latest
|
||||
if: "github.repository == 'google-gemini/gemini-cli'"
|
||||
runs-on: 'ubuntu-latest'
|
||||
steps:
|
||||
- name: 'Generate GitHub App Token'
|
||||
id: 'generate_token'
|
||||
@@ -131,16 +131,14 @@ jobs:
|
||||
}
|
||||
});
|
||||
|
||||
// 4. Handle PR Contribution Policy (Nudge at 7d, Close at 14d)
|
||||
// 4. Handle PR Contribution Policy (Nudge at 7d, Close at 7d after nudge)
|
||||
const PR_NUDGE_DAYS = 7;
|
||||
const PR_CLOSE_DAYS = 14;
|
||||
const nudgeThreshold = new Date(now.getTime() - (PR_NUDGE_DAYS * 24 * 60 * 60 * 1000));
|
||||
const prCloseThreshold = new Date(now.getTime() - (PR_CLOSE_DAYS * 24 * 60 * 60 * 1000));
|
||||
|
||||
// Nudge
|
||||
await processItems(`repo:${owner}/${repo} is:open is:pr -label:"help wanted" -label:"🔒 maintainer only" -label:"status/pr-nudge-sent" created:<${nudgeThreshold.toISOString()}`, async (pr) => {
|
||||
if (['OWNER', 'MEMBER', 'COLLABORATOR'].includes(pr.author_association) || pr.user.type === 'Bot') return;
|
||||
|
||||
|
||||
core.info(`Nudging PR #${pr.number} for contribution policy.`);
|
||||
if (!dryRun) {
|
||||
await github.rest.issues.addLabels({ owner, repo, issue_number: pr.number, labels: ['status/pr-nudge-sent'] });
|
||||
@@ -152,10 +150,10 @@ jobs:
|
||||
});
|
||||
|
||||
// Close
|
||||
await processItems(`repo:${owner}/${repo} is:open is:pr -label:"help wanted" -label:"🔒 maintainer only" created:<${prCloseThreshold.toISOString()}`, async (pr) => {
|
||||
await processItems(`repo:${owner}/${repo} is:open is:pr label:"status/pr-nudge-sent" -label:"help wanted" -label:"🔒 maintainer only" updated:<${nudgeThreshold.toISOString()}`, async (pr) => {
|
||||
if (['OWNER', 'MEMBER', 'COLLABORATOR'].includes(pr.author_association) || pr.user.type === 'Bot') return;
|
||||
|
||||
core.info(`Closing PR #${pr.number} per contribution policy (no 'help wanted').`);
|
||||
|
||||
core.info(`Closing PR #${pr.number} per contribution policy (no 'help wanted' and grace period elapsed).`);
|
||||
if (!dryRun) {
|
||||
await github.rest.issues.createComment({
|
||||
owner, repo, issue_number: pr.number,
|
||||
|
||||
Reference in New Issue
Block a user