This is a Linux daemon that checks every hour whether a github repository has been pushed to. A notification is sent every hour with the relevant information.
- Install the golang toolchain.
- In
cmd/notifyGitProjectd
, rungo build
to produce an executable namednotifyGitProjectd
. - Add a
.env
incmd/notifyGitProjectd
with the keyGH_TOKEN
and a GitHub personal access token with the requirement of reading user repositories.
To make this a linux daemon:
- Create a
/etc/systemd/system/notifyGitProjectd.service
, with the contents:
[Unit]
Description=Notify Git Project
[Service]
ExecStart=<PATH-TO-PROJECT>/notifyGitProjectd/cmd/notifyGitProjectd/notifyGitProjectd <OWNER-OF-REPO> <REPO-NAME>
WorkingDirectory=<PATH-TO-PROJECT>/notifyGitProjectd/cmd/notifyGitProjectd/
Restart=always
User=<USERNAME>
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl start notifyGitProjectd
sudo systemctl enable notifyGitProjectd
sudo systemctl status notifyGitProjectd