2017 © Pedro Peláez
 

library git-notify

notify the git push.

image

yansongda/git-notify

notify the git push.

  • Wednesday, March 21, 2018
  • by yansongda
  • Repository
  • 1 Watchers
  • 6 Stars
  • 16 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 12 Versions
  • 0 % Grown

The README.md

😆Git Notify😆

git 代码推送通知 , (*1)

在公司进行开发时,如何优雅而又不尴尬的让老板知道自己每天几点下班,好让老板加工资,这是一个问题。, (*2)

现在应该基本每个公司用钉钉,而钉钉又有机器人可以自动推送,😆,git 可以使用 webhook,于是,就有了这样一个系统。, (*3)

当然,根据 git 的 webhook 特性,大家可以打开脑洞,随意实现有意思的功能。, (*4)

特性

  1. 隐藏不需要关心的内部流程
  2. 可以随意增加现有类库中没有的服务

支持的服务

git 提供商

  • gitee (码云)

destinations

  • dingtalk (钉钉)
    实现消息推送功能

安装

composer require yansongda/git-notify, (*5)

使用方法

git webhook

http://your-domain/?from=gitee&to=dingtalk, (*6)

服务端

<?php

require './vendor/autoload.php';

$notify = new Yansongda\GitNotify\GitNotify();

// 可选。gitee 可以设置 webhook 密码,防止 URL 被恶意请求
// $notify->from->password = '123456';

// 可选。可以随意设置发送模板与格式。这里用到闭包。
// $from 为 git 服务。
/* $notify->destination->setTemplate(function ($from) {
    $data['msgtype'] = 'hahaha';
    $data['text']['content'] = "姓名:" . $from->user_name .
                                "\n\before:" . $from->before .
                                "\n\nafter:" . $from->after .
                                "\n\n推送时间:" . date('Y-m-d H:i:s');

    return $data;
});*/

$notify->destination->gateway = 'https://oapi.dingtalk.com/robot/send?access_token=36c01ca8552fa8f9f6xxxxx';

$response = $notify->destination->apply();
$result = $response->getBody()->getContents();

LICENSE

MIT, (*7)

The Versions

21/03 2018

dev-master

9999999-dev

notify the git push.

  Sources   Download

MIT

The Requires

 

by Avatar yansongda

git notify

16/09 2017

v1.2.1

1.2.1.0

notify the git push.

  Sources   Download

MIT

The Requires

 

by Avatar yansongda

git notify

16/09 2017

v1.2.0

1.2.0.0

notify the push to the chatgroup.

  Sources   Download

MIT

The Requires

 

by Avatar yansongda

git notify

13/09 2017

v1.1.6

1.1.6.0

notify the push to the chatgroup.

  Sources   Download

MIT

The Requires

 

by Avatar yansongda

git notify

13/09 2017

v1.1.5

1.1.5.0

notify the push to the chatgroup.

  Sources   Download

MIT

The Requires

 

by Avatar yansongda

git notify

13/09 2017

v1.1.4

1.1.4.0

notify the push to the chatgroup.

  Sources   Download

MIT

The Requires

 

by Avatar yansongda

git notify

13/09 2017

v1.1.3

1.1.3.0

notify the push to the chatgroup.

  Sources   Download

MIT

The Requires

 

by Avatar yansongda

git notify

12/09 2017

v1.1.2

1.1.2.0

notify the push to the chatgroup.

  Sources   Download

MIT

The Requires

 

by Avatar yansongda

git notify

12/09 2017

v1.1.1

1.1.1.0

notify the push to the chatgroup.

  Sources   Download

MIT

The Requires

 

by Avatar yansongda

git notify

12/09 2017

v1.1.0

1.1.0.0

notify the push to the chatgroup.

  Sources   Download

MIT

The Requires

 

by Avatar yansongda

git notify

12/09 2017

v1.0.1

1.0.1.0

notify the push to the chatgroup.

  Sources   Download

MIT

The Requires

 

by Avatar yansongda

git notify

12/09 2017

v1.0.0

1.0.0.0

notify the push to the chatgroup.

  Sources   Download

MIT

The Requires

 

by Avatar yansongda

git notify