inline hooks.json
This commit is contained in:
@@ -80,10 +80,45 @@
|
|||||||
(builtins.readFile ./pigeon.sh);
|
(builtins.readFile ./pigeon.sh);
|
||||||
};
|
};
|
||||||
|
|
||||||
hooks = pkgs.writeText "pigeon-hooks.json"
|
hooks = pkgs.writeText "pigeon-hooks.json" (builtins.toJSON [
|
||||||
(builtins.replaceStrings [ "@nq@" "@pigeon@" ]
|
{
|
||||||
[ "${pkgs.nq}/bin/nq" "${pigeon}/bin/pigeon" ]
|
id = "release";
|
||||||
(builtins.readFile ./hooks.json));
|
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 {
|
pigeon-webhook = pkgs.writeShellApplication {
|
||||||
name = "pigeon-webhook";
|
name = "pigeon-webhook";
|
||||||
|
|||||||
-41
@@ -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 }}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
Reference in New Issue
Block a user