<commit_before>Github Issue Auto-Responder
===========================
Polls GitHub project issues on a regular interval to look for issues *without comments*
and tries to identify a proper response for the ticket, adding a comment and/or a
label if so.

Requirements
------------
Python 2.6, 2.7

Installation Instructions
-------------------------
1. Install via pip:

    pip install github-issue-autoresponder

2. Create a Personal API Token on GitHub: https://github.com/blog/1509-personal-api-tokens
3. Copy `/usr/share/github_issue_autoresponder/etc/github_issue_autoresponder.yml` to `/etc`
4. Edit `/etc/github_issue_autoresponder.yml `

Optional (RHEL distros):

    cp /usr/share/github_issue_autoresponder/etc/github_issue_autoresponder.initd /etc/init.d/github_issue_autoresponder
    chmod u+x /etc/init.d/github_issue_autoresponder
    chkconfig github_issue_autoresponder on

Running
-------

    github_issue_autoresponder -c path/to/configuration [-f]

Configuration
-------------
The configuration file uses *YAML* syntax for its markup and **whitespace/indentation is important**. For more information on *YAML*, please visit http://yaml.org. A good resource for configuration lint checking is http://yamllint.com.

The configuration is set per user/org and repository and may have multiple rules. Each rule has multiple sections: strings, response and action.

 - *strings* should be entered all lowercase* and match the lowercase title and body of an issue. If a string is matched, any values in the response section will be added as a comment any labels in action > label will be added.

 - *response* is a list of strings to add to the comment. If there is more than one item in the list, they will be added as a list, if there is only one, it will just be the string.

 - *action* currently only supports labels but may do more in the future. If any of the strings are matched, labels in the labels sub tree will be added. Labels should be entered as a list.

 To change how often the application will poll, edit the Application > wake_interval value in seconds. 

Example
-------
The following configuration would scan issues at https://github.com/you/repo_name running two rules:

 - rule_one scans for "string value 1" and "string value 2" and if found in the title or body of the issue, it will add two bullets from the response stanza of the config and it will add a "pending review" label.
 - rule two scans for "foo" in the title or body and adds the comment "This issue matched on foo" 


    %YAML 1.2
    ---
    Application:
      api_url: https://api.github.com
      wake_interval: 300<commit_msg>Try and fix formatting issue<commit_after>Github Issue Auto-Responder
===========================
Polls GitHub project issues on a regular interval to look for issues *without comments*
and tries to identify a proper response for the ticket, adding a comment and/or a
label if so.

Requirements
------------
Python 2.6, 2.7

Installation Instructions
-------------------------
1. Install via pip:

    pip install github-issue-autoresponder

2. Create a Personal API Token on GitHub: https://github.com/blog/1509-personal-api-tokens
3. Copy `/usr/share/github_issue_autoresponder/etc/github_issue_autoresponder.yml` to `/etc`
4. Edit `/etc/github_issue_autoresponder.yml `

Optional (RHEL distros):

    cp /usr/share/github_issue_autoresponder/etc/github_issue_autoresponder.initd /etc/init.d/github_issue_autoresponder
    chmod u+x /etc/init.d/github_issue_autoresponder
    chkconfig github_issue_autoresponder on

Running
-------

    github_issue_autoresponder -c path/to/configuration [-f]

Configuration
-------------
The configuration file uses YAML syntax for its markup and **whitespace/indentation is important**. For more information on YAML, please visit http://yaml.org. A good resource for configuration lint checking is http://yamllint.com.

The configuration is set per user/org and repository and may have multiple rules. Each rule has multiple sections: strings, response and action.

 - *strings* should be entered all lowercase* and match the lowercase title and body of an issue. If a string is matched, any values in the response section will be added as a comment any labels in action > label will be added.

 - *response* is a list of strings to add to the comment. If there is more than one item in the list, they will be added as a list, if there is only one, it will just be the string.

 - *action* currently only supports labels but may do more in the future. If any of the strings are matched, labels in the labels sub tree will be added. Labels should be entered as a list.

 To change how often the application will poll, edit the Application > wake_interval value in seconds. 

Example Configuration
---------------------
The following configuration would scan issues at https://github.com/you/repo_name running two rules:

 - rule_one scans for "string value 1" and "string value 2" and if found in the title or body of the issue, it will add two bullets from the response stanza of the config and it will add a "pending review" label.
 - rule two scans for "foo" in the title or body and adds the comment "This issue matched on foo" 

File:

    %YAML 1.2
    ---
    Application:
      api_url: https://api.github.com
      wake_interval: 300
{'fraction_non_alphanumeric': 0.09463781749764817, 'fraction_numerical': 0.007149576669802446, 'mean_word_length': 3.508905852417303, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '390405', 'n_tokens_mistral': 1491, 'n_tokens_neox': 1391, 'n_words': 693}