当特定包在github上获得新版本时得到通知

github-release-notifier的Python项目详细描述


https://github.com/femtopixel/github-release-notifier/raw/master/logo.png

Github发布通知程序

latest releaselatest releaseDocker pullDocker starsBitcoin donationLitecoin donationPayPal donationBuy me a coffee

此程序将允许您收到github新版本的通知

安装

pip3 install github-release-notifier

使用量

usage: github-release-notifier [-h] [--action {cron,subscribe,unsubscribe}] [--package PACKAGE]
              [--webhook WEBHOOK] [--uuid UUID]

optional arguments:
  -h, --help            show this help message and exit
  --action {cron,subscribe,unsubscribe}, -a {cron,subscribe,unsubscribe}
                        Action to do (default: cron)
  --package PACKAGE, -p PACKAGE
                        Github package name / url (required for
                        subscribe/unsubscribe) - prints uuid on subscription
  --webhook WEBHOOK, -w WEBHOOK
                        URL to your webhook (required for
                        subscribe/unsubscribe)
  --uuid UUID, -u UUID  UUID of your webhook (required for unsubscribe)

示例

首先,我注册我的webhook:

github-release-notifier --action subscribe --webhook https://example.com/updated --package jaymoulin/google-music-manager

将打印uuid。取消订阅webhook需要此uuid。

当jaymoolin/google音乐管理器发布一个新版本时,https://example.com/updated将使用http方法post和body调用,一个类似这样的json:

{
    "date": [2017, 11, 13, 19, 46, 35, 0, 317, 0],
    "version": "0.7.2",
    "title": "Fixes split modules",
    "content": "",
    "media": "https://avatars0.githubusercontent.com/u/14236493?s=60&v=4",
    "author": "jaymoulin"
    "package_name": "jaymoulin/google-music-manager"
}

为了实现这一点,系统应该检查是否发布了新版本。 我们可以通过调用github release notifier来实现这一点,无需任何参数或将action设置为cron(这是默认设置)。

要使此过程自动化,我们可以将此过程添加到cronjob中:

(crontab -l ; echo "0 0 * * * github-release-notifier") | sort - | uniq - | crontab -

如果新版本已经发布,这将每天午夜检查。

配置

可以定义环境变量来更改默认的hooks版本数据库文件(纯json文件)

GRN_VERSIONS_FILE: Path to saved versions (default: ${HOME}/.github_release_notifier/versions)
GRN_HOOKS_FILE: Path to hooks configuration (default: ${HOME}/.github_release_notifier/hooks)

Docker用法

首先运行后台程序

docker run --name GRN -d femtopixel/github-release-notifier

您可以将卷装载到/root/.github\u release\u notifier/以跟踪webhook和版本

示例:

docker run --name GRN -d -v /path/to/your/saves:/root/.github_release_notifier/ femtopixel/github-release-notifier

然后注册webhook:

docker exec GRN -a subscribe -p jaymoulin/google-music-manager -w https://example.com/updated

提交错误和功能请求

在github上跟踪错误和功能请求

作者

Jay Moulin jaymoulin+github-release-notifier@gmail.com另请参阅参与此计划的贡献者列表。

许可证

github release notifier是根据mit许可证授权的

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何通过jamod读取控制器的输入状态?   java Back bean方法在使用两个h的单一表单时未调用:selectonemenus和command button   mockitojava中的单元测试Mock继承方法   java在不传递到构造函数的情况下,将一个类的实例使用到另一个类中的最佳方法是什么   java Spring MVC:如何通过API在Dozer的toplevel字段中允许空值?   java hibernate到MSSQL服务器的连接被拒绝:连接   java动态调用现有变量   在java中扩展多个类的泛型   java使用JNA Ptrace获取linux中外部进程的信息?   eclipse获取Java项目中所有构建错误的最快方法是什么?   java将动态数组拆分为多个数组   java安卓:将json保存到sqlite   java获取最近时间Android   java如何为多对多关联编写HQL查询?   java Docker compose for mysql和spring应用程序拒绝访问   java查找数组(如果它是另一个数组的子集)   java如何在另一个具有相同数据类型参数的泛型类(或接口)中使用泛型类(或接口),而无需强制转换   Apache POI java。lang.NoClassDefFoundError:org/apache/commons/compress/utils/InputStreamStatistics   java使用Jackson将JSON反序列化为异构元素列表   使用MapReduce实现java规范化