inline hooks.json

This commit is contained in:
2026-10-16 00:10:59 -04:00
parent 34841fa222
commit 8b550cfe10
2 changed files with 39 additions and 45 deletions
+39 -4
View File
@@ -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";
-41
View File
@@ -1,41 +0,0 @@
[
{
"id": "release",
"execute-command": "@nq@",
"include-command-output-in-response": false,
"pass-arguments-to-command": [
{ "source": "string", "name": "@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 }}"
}
}
]
}
}
]