Metadata-Version: 2.1
Name: gh-pr-commenter
Version: 1.0.0
Summary: Simple Script to post a github comment to a given PR based on a jinja2 template
Home-page: https://github.com/enen92/github-pr-log-commenter
Author: enen92
License: UNKNOWN
Download-URL: https://github.com/enen92/github-pr-log-commenter/archive/main.zip
Keywords: github pr-comment
Platform: UNKNOWN
Classifier: Operating System :: POSIX :: Linux
Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Topic :: Utilities
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Requires-Python: >=3.5
Description-Content-Type: text/markdown
Requires-Dist: pygithub
Requires-Dist: jinja2

# github-pr-log-commenter

Simple script that posts a comment to a Github PR based on a jinja2 template. This template has two simple variables:

`{{pullRequestAuthor}}`: Will be replaced by the author of the pull request

`{{contents}}`: Will be replaced by the contents of a given file (e.g. a log)

You need to define the `GH_TOKEN` environment variable with at least the repo scope.

# usage:

```
usage: github-pr-commenter.py [-h] repo prnumber template logfile

positional arguments:
  repo        Organization and repository (e.g. xbmc/repo-plugins)
  prnumber    PR number (e.g. 5)
  template    Jinja 2 template file to generate a comment from
  logfile     Log file to parse (e.g. mylog.log)

optional arguments:
  -h, --help  show this help message and exit
```

## Example template

```
## Something was successfull
Hey @{{pullRequestAuthor}},
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.


<details>
  <summary>
    <strong>
     Expand log file
    </strong>
  </summary>

` ` `
{{contents}}
` ` `

```

