Package: github-bot-close-inactive-issues
Bot for automatically closing inactive GitHub issues. Based on
configuration, bot will close inactive issues and/or post comments
warning that issues will be closed.For each issue, bot will calculate a last modified time based on
comments, events, and issue creation.If issue was last modified more thanwarning_startdays ago, a
warning comment is posted to the issue.Warning messages will not be posted more than everywarning_frequencydays.If issue was last modified more thanclosingdays ago, a comment
is posted and the issue is closed.Both warning comment and closing comment are configurable.IntallationStable Releasepipinstallgithub-bot-close-inactive-issuesDevelopment Releasegitclonehttps://github.com/bstriner/github-bot-close-inactive-issues.gitcdgithub-bot-close-inactive-issuespythonsetup.pyinstallConfigurationBot expects the configuration filegithub_bot.ymlin the user’s home
directory. A different file path can be provided by using the--configcommand line option. Most configuration can also be
overridden by the command line.user:usertoken:tokenrepo:user/repomessages:warning:>Warning: this issue has been inactive for {days_inactive} days andwill be automatically closed on {deadline:%Y-%m-%d} if there is no further activity.closing:>Notice: this issue has been closed because it has been inactive for {days_inactive} days.You may reopen this issue if it has been closed in error.schedule:warning_start:14# days before starting warningswarning_frequency:7# minimum time between warningsclosing:56# days before closing# label to add to issues when closing automatically (optional)# label: inactive# issue warnings instead of closing until this date (optional)# first_closing_date: 2017-03-01 12:00:00# path to custom logging configuration (optional)# logging-config: /home/user/logging.conf# Do not warn or close issues opened by these users (optional)# ignore-users:#   - username1#   - username2# Do not warn or close issues with these labels (optional)# ignore-labels:#   - label1#   - label2Scriptsgithub-rate-limit.pyUsegithub-rate-limit.pyto check connection and rate limit.usage:github-rate-limit.py[-h][--configCONFIG][--logging-configLOGGING_CONFIG][--userUSER][--tokenTOKEN]Checkratelimit.optionalarguments:-h,--helpshowthishelpmessageandexit--configCONFIGConfigurationfile--logging-configLOGGING_CONFIGLoggingconfigurationfile--userUSERGithubuser--tokenTOKENGithubtokengithub-close-inactive-issues.pyUsegithub-close-inactive-issues.pyto close inactive issues and
post warnings.usage:github-close-inactive-issues.py[-h][--configCONFIG][--logging-configLOGGING_CONFIG][--userUSER][--tokenTOKEN][--repoREPO][--test]Runbottomaintainissues.optionalarguments:-h,--helpshowthishelpmessageandexit--configCONFIGConfigurationfile--logging-configLOGGING_CONFIGLoggingconfigurationfile--userUSERGithubuser--tokenTOKENGithubtoken--repoREPORepository--testPrintactionsthatwouldbetakenbutdonotmodifyrepositoryNotesTokens and Rate LimitsYou can use a password for your token but you will be rate limited to 60
requests per hour. Create an access token to raise the rate limit to
5000 per hour.Creating an Access Token for Command Line
UseYou may provide the access token to the bot either on the command line
or in the configuration file.You should set permissions to the configuration file such that only the
bot can view it.Use a Dedicated AccountUse a dedicated user account for the bot. The bot calculates last
modified time by checking for comments for users other than the bot.
Otherwise, each time the bot posted a warning the last modified date
would reset. If you use your own account for the bot, it may close an
issue if that account is the only one commenting on that issue.Make sure to verify your account’s email addressAdd that account as a collaborator to your repositoryKeep your bot account password and token secret!first_closing_dateIf you includefirst_closing_datein your configuration, the bot
will not begin closing issues until that date. The bot will issue
warnings as usual.If the calculated closing date of an issue is before thefirst_closing_date, the closing date will be pushed back until that
date.LoggingBot uses pythonloggingmodule. A defaultlogging.confis
provided but can be overridden by includinglogging-configingithub_bot.ymlor passing--logging-configon the command line.LabelsBot can add a label to issues when they are closed. Make sure to create
that label on GitHub and confirm that the name exactly matches the name
in the configuration file.Ignoring usersBot can ignore issues created by selected users, such as the repository
owner.Questions?Please feel free to submit issues or pull requests if you have any
questions or concerns. Cheers!