Simple Script to post a github comment to a given PR based on a jinja2 template
Project description
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}}
` ` `
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gh-pr-commenter-1.0.0.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for gh_pr_commenter-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1ebe911a31381ca321b5a7457cbcc63b0e4f296f096fa64b513e5bcd6c86a4e |
|
MD5 | dff56d7c1cf22892623b607e8bac58e9 |
|
BLAKE2b-256 | 9c0c04f451e94f838f4a33b583dff78754fd82c256eaa8cc98e6b72d5ca7f62e |