Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

yonib05
Copy link
Member

@yonib05 yonib05 commented Sep 9, 2025

Description

Adds two GitHub workflows to automatically manage stale issues with configurable timeouts.

Key features include
• Environment variables for all settings (label names, timeouts, auth modes)
• Flexible authorization modes (user list or write permissions)
• Label removal when external users respond
• Optional replacement label when removing auto-close labels
• Support for issues, pull requests, or both
• Weekday-only scheduling (9 AM EST, Monday-Friday)

Files Added

• .github/workflows/auto-close-3-days.yml - Auto-close workflow with 3-day timeout
• .github/workflows/auto-close-7-days.yml - Auto-close workflow with 7-day timeout

Workflow Logic

  1. Find Issues: Locate open issues with specified label
  2. Check Comments: Analyze comments since the label was added
  3. Remove label if external users commented.
  4. Close issues after timeout if only authorized users commented.
  5. Optional Labeling: Add replacement label when removing auto-close label

Related Issues

Documentation PR

Type of Change

New feature

Testing

Tested on a forked branch, tested shadow mode, live mode, removal, and addition of labels.

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…support

- Daily workflow checks issues with configurable label after X days
- Removes label if unauthorized users comment, closes if only authorized users
- Supports team-based or write-access authorization modes
- Includes comprehensive input validation and error handling
- Adds manual trigger with dry-run mode for safe testing
- Replace github.rest.search.issuesAndPullRequests with github.rest.issues.listForRepo
- Add pagination support to handle repositories with many labeled issues
- Add missing try block around main logic
- Fix indentation alignment for proper nesting
- Resolves "Unexpected token 'catch'" error
- Check for unauthorized comments before time validation
- Remove label instantly when non-authorized users respond
- Add REPLACEMENT_LABEL environment variable for optional label substitution
- Apply replacement label when unauthorized users comment and auto-close label is removed
- Merge auto-close-3-days.yml and auto-close-7-days.yml into auto-close.yml
- Use matrix strategy to handle both 3-day and 7-day label processing
@Unshure
Copy link
Member

Unshure commented Sep 11, 2025

Can you share an example workflow where this has run?

@yonib05
Copy link
Member Author

yonib05 commented Sep 11, 2025

@yonib05 yonib05 merged commit 066a427 into strands-agents:main Sep 12, 2025
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants