From 6b9300b37f805a7e983bfd7f33bd817ad190ba36 Mon Sep 17 00:00:00 2001 From: Paul-Nicolas Madelaine Date: Sun, 11 Feb 2024 21:13:03 +0100 Subject: [PATCH] Fix ref parsing in `githubWebhook` (#14) Make `githubWebhook` parse refs properly when they contain more than two slashes. Closes: #13 --- nix/lib/github/githubWebhook.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/lib/github/githubWebhook.nix b/nix/lib/github/githubWebhook.nix index 94209627..653ab003 100644 --- a/nix/lib/github/githubWebhook.nix +++ b/nix/lib/github/githubWebhook.nix @@ -22,7 +22,7 @@ utils: lib: { echo null | jq --argjson body "$body" '[] | if $body.created or $body.deleted then . + [{"command":"UpdateJobsets"}] else . end - | if $body.deleted | not then . + [{"command":"EvaluateJobset","name":$body.ref|split("/")|.[2]}] else . end + | if $body.deleted | not then . + [{"command":"EvaluateJobset","name":$body.ref|split("/")|.[2:]|join("/")}] else . end | .' ''; };