inline hooks.json
This commit is contained in:
@@ -80,10 +80,45 @@
|
||||
(builtins.readFile ./pigeon.sh);
|
||||
};
|
||||
|
||||
hooks = pkgs.writeText "pigeon-hooks.json"
|
||||
(builtins.replaceStrings [ "@nq@" "@pigeon@" ]
|
||||
[ "${pkgs.nq}/bin/nq" "${pigeon}/bin/pigeon" ]
|
||||
(builtins.readFile ./hooks.json));
|
||||
hooks = pkgs.writeText "pigeon-hooks.json" (builtins.toJSON [
|
||||
{
|
||||
id = "release";
|
||||
execute-command = "${pkgs.nq}/bin/nq";
|
||||
include-command-output-in-response = false;
|
||||
pass-arguments-to-command = [
|
||||
{ source = "string"; name = "${pigeon}/bin/pigeon"; }
|
||||
{ source = "payload"; name = "project.id"; }
|
||||
{ source = "payload"; name = "project.namespace"; }
|
||||
{ source = "payload"; name = "project.name"; }
|
||||
{ source = "payload"; name = "commit.id"; }
|
||||
{ source = "payload"; name = "tag"; }
|
||||
{ source = "payload"; name = "created_at"; }
|
||||
];
|
||||
trigger-rule.and = [
|
||||
{
|
||||
match = {
|
||||
type = "value";
|
||||
parameter = { source = "header"; name = "X-Gitlab-Event"; };
|
||||
value = "Release Hook";
|
||||
};
|
||||
}
|
||||
{
|
||||
match = {
|
||||
type = "value";
|
||||
parameter = { source = "payload"; name = "action"; };
|
||||
value = "create";
|
||||
};
|
||||
}
|
||||
{
|
||||
match = {
|
||||
type = "value";
|
||||
parameter = { source = "header"; name = "X-Gitlab-Token"; };
|
||||
value = "{{ getenv `PIGEON_GITLAB_SECRET` | js }}";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
]);
|
||||
|
||||
pigeon-webhook = pkgs.writeShellApplication {
|
||||
name = "pigeon-webhook";
|
||||
|
||||
Reference in New Issue
Block a user