Skip to content

Instantly share code, notes, and snippets.

View upggr's full-sized avatar

Ioannis Kokkinis upggr

View GitHub Profile
0xf69019Bd9a90bFD10C7336A3162AC1947e333DE0
@upggr
upggr / windows github webhook
Last active February 5, 2024 08:24
Workflow for automated github pull on windows
On the github website there is guide detailing a worfklow for the developer that wants to have continuous integration on a linux server.
This has been detailed in many gists and goes like this in its simplest form :
1.git clone on your public_html folder (after you create ssh keys etc)
2.create a file gitpull.php with the command : exec(git pull); inside it
3.create a webhook on github to call yourwebsite.com/gitpull.php
What about windows though? you can install git bash, but the above will not work because of permissions, mostly because the user that will invoke the url will be whatever user is running the process that calls php (for example SYSTEM or IUSR)
I have a better, clever solution for that, that uses.. the windows log! Also great for troubleshooting your deployments: