
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
code-hosting-webhooks
Advanced tools
This is an easy to use nodeJS based web hook for GitLab.
npm install gitlabhook
var gitlabhook = require('gitlabhook');
var gitlab = gitlabhook({/* options */} [, callback]);
gitlab.listen();
Configure a WebHook URL to whereever the server is listening.
0.0.0.0
3420
gitlabhook.conf
['/etc/gitlabhook/', '/usr/local/etc/gitlabhook/', '.']
false
. Mostly only for debugging purposes.logger:{info:function(s){}, error:function(s){}}
). Mostly only for debugging purposes.{repo1:'cmd1', repo2:['cmd2a','cmd2b','cmd2c']}
)/bin/sh
The config file will be ignored if a callback function is declared.
Example config file with task definitions:
{
"tasks": {
"myRepo": "/usr/local/bin/myDeploy %g",
"*": ["echo 'GitLab Server %s'",
"echo 'Repository: %r'",
"echo 'Event: %k'",
"echo 'User: %u'",
"echo 'Branch: %b'",
"echo 'Git Url: %g'",
"echo 'Last Commit: %i'",
"echo '\tMessage: %m'",
"echo '\tTime: %t'"]
},
"keep":false,
"logger": false,
"cmdshell":"/bin/bash"
}
The *
matches any tasks.
The place holders are:
%s
: GitLab server's IP address%r
: name of the repository (e.g. myRepo
)%k
: kind of event (e.g. tag_push
)%u
: owner of the repository (user name)%b
: branch reference (e.g. refs/heads/master
)%g
: ssh-based cloning url on the GitLab server (e.g. git@gitlab.host:rolf.niepraschk/myRepo.git
)%h
: http-based cloning url on the GitLab server (e.g. http://gitlab.host/rolf.niepraschk/myRepo.git
)%i
: id of the last commit%t
: timestamp of the last commit%m
: message of the last commitThe file gitlabhook-server.js
shows an example GitLab Hook server listen at port 3420.
The file gitlabhook.service
is intended to use as a systemd sercvice. The Makefile
helps to create an rpm archive for a systemd based OS. Call
make rpm
MIT
FAQs
This is an easy to use nodeJS based web hook for GitLab.
The npm package code-hosting-webhooks receives a total of 2 weekly downloads. As such, code-hosting-webhooks popularity was classified as not popular.
We found that code-hosting-webhooks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.