feat: add --yes flag to auto-close duplicate issues without prompting

This commit is contained in:
Paul Gauthier (aider) 2024-10-24 12:34:01 -07:00
parent eb8fdf483e
commit e9627cb3c6

View file

@ -1,7 +1,6 @@
#!/usr/bin/env python3
add a --yes switch @ai
import argparse
import os
import re
from collections import defaultdict
@ -114,6 +113,10 @@ def comment_and_close_duplicate(issue, oldest_issue):
def main():
parser = argparse.ArgumentParser(description='Handle duplicate GitHub issues')
parser.add_argument('--yes', action='store_true', help='Automatically close duplicates without prompting')
args = parser.parse_args()
if not TOKEN:
print("Error: Missing GITHUB_TOKEN environment variable. Please check your .env file.")
return
@ -144,6 +147,7 @@ def main():
f" {oldest_issue['html_url']} ({oldest_issue['state']})"
)
if not args.yes:
# Confirmation prompt
confirm = input("Do you want to comment and close duplicate issues? (y/n): ")
if confirm.lower() != "y":