Convert auto-close duplicates workflow to dry run mode

Instead of automatically closing duplicate issues, the workflow now:
- Logs URLs of issues that would have been closed
- Runs in dry run mode for safety
- Preserves all detection logic but skips actual closing actions

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Boris Cherny
2025-08-05 17:17:51 -07:00
parent 3d5ef4e8c0
commit 611956def4

View File

@@ -1,5 +1,5 @@
name: Auto-close duplicate issues
description: Auto-close issues marked as duplicates after 3 days if no response
name: Auto-close duplicate issues (DRY RUN)
description: Dry run - logs issues that would be auto-closed as duplicates after 3 days if no response
on:
schedule:
- cron: '0 9 * * *'
@@ -72,24 +72,7 @@ jobs:
if (authorThumbsDown) continue;
// Auto-close the issue as duplicate
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
state: 'closed',
state_reason: 'duplicate'
});
// Add closing comment
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
body: `This issue has been automatically closed as a duplicate after 3 days with no response. If this was closed in error, please reopen it.
🤖 Generated with Claude Code`
});
console.log(`Auto-closed issue #${issue.number} as duplicate`);
// DRY RUN: Log the issue that would be auto-closed
const issueUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/issues/${issue.number}`;
console.log(`[DRY RUN] Would auto-close issue #${issue.number} as duplicate: ${issueUrl}`);
}