kwangchin / githubhook Goto Github PK
View Code? Open in Web Editor NEWGitHub Post-Receive Deployment Hook
Home Page: http://kwangchin.github.io/GitHubHook
License: MIT License
GitHub Post-Receive Deployment Hook
Home Page: http://kwangchin.github.io/GitHubHook
License: MIT License
If the payload is missing, it won't be logged with the way the class is setup, even if debug is enabled. This is because, in the constructor, _notFound is called before enableDebug can be. I fixed this by changing the constructor:
function __construct($debug = FALSE) {
$this->_debug = $debug;
I left the enableDebug method - it might be useful in some cases.
When using the class, it is as simple as:
$hook = new GitHubHook($debug = TRUE);
($debug =
included for clarity in an example case, but is unnecessary)
I think it would be better to use syslog for logging. The default setting of having log directory directly on the project root could pose security issue for users who are unaware of the vulnerability. Using syslog also solves the problem of logrotate
Your syntax (https://github.com/kwangchin/GitHubHook/blob/master/class.GitHubHook.php#L173) is:
$cmd='git pull --git-dir='. escapeshellarg($branch['path']) .' options '. escapeshellarg($branch['name']);
it should be:
$cmd='git --git-dir='. escapeshellarg($branch['path'] . '/.git') .' --work-tree='. escapeshellarg($branch['path']) .' pull origin '. escapeshellarg($branch['name']);
Also, the '/.git' should probably check for a slash at the end of the path and use '.git' if a slash already exists.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.