File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 1
1
# webhooks
2
2
git webhooks
3
+
4
+ ##配置要求
5
+ php.ini 开启shell_exec函数
6
+ http请求头:Content_type = application/json
Original file line number Diff line number Diff line change 29
29
$ res_log = '------------------------- ' .PHP_EOL ;
30
30
$ res_log .= $ content ['pusher ' ]['name ' ] . ' 在 ' . date ('Y-m-d H:i:s ' ) . '向 ' . $ content ['repository ' ]['name ' ] . '项目的 ' . $ content ['ref ' ] . '分支push了 ' . PHP_EOL ;
31
31
$ res_log .= $ res .PHP_EOL ;
32
- file_put_contents ("git-webhook.txt " , $ res_log , FILE_APPEND );//追加写入
32
+ file_put_contents ("git-webhook.txt " , $ res_log , FILE_APPEND );//追加写入
33
+
34
+ echo 'success ' ;
Original file line number Diff line number Diff line change 24
24
$ res_log .= $ content ['user_name ' ] . ' 在 ' . date ('Y-m-d H:i:s ' ) . '向 ' . $ content ['repository ' ]['name ' ] . '项目的 ' . $ content ['ref ' ] . '分支push了 ' . $ content ['total_commits_count ' ] . '个commit: ' . PHP_EOL ;
25
25
$ res_log .= $ res .PHP_EOL ;
26
26
file_put_contents ("git-webhook.txt " , $ res_log , FILE_APPEND );//追加写入
27
+ echo 'success ' ;
27
28
}
You can’t perform that action at this time.
0 commit comments