From 8bb5d4205fa733b2b3bde560a36ee96d84d6db26 Mon Sep 17 00:00:00 2001 From: Jose Donizetti Date: Mon, 30 Jan 2023 08:13:48 -0300 Subject: [PATCH] add binary_sha discard --- profile/exec.jq | 5 ++++- profile/profile-config.json | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/profile/exec.jq b/profile/exec.jq index 584b291..50c91bf 100644 --- a/profile/exec.jq +++ b/profile/exec.jq @@ -7,6 +7,9 @@ def discard_items(patterns): if patterns | length > 0 then map(select([test(patt # discard_items_pairs discards all pairs of items in the input array of strings that the first element in the pair matches any of the regular expressions in the patterns array of strings def discard_items_pairs(patterns): if patterns | length > 0 then delpaths([paths([test(patterns[])] | any) | .,map(.+1)]) else . end; +# discard_binary_sha256 discards all process where the sha matches the input array of strings +def discard_binary_sha256(patterns): if patterns | length > 0 then select([.binary_sha256 | contains(patterns[])] | any | not) else . end; + [ .[] | { @@ -16,5 +19,5 @@ def discard_items_pairs(patterns): if patterns | length > 0 then delpaths([paths binary_sha256: getarg("sha256"), process_args: getarg("argv") | discard_items_pairs($config[0].args_discard_pair) | discard_items($config[0].args_discard), process_env: (if isempty(getarg("env")) | not then (discard_items($config[0].env_discard) | sort) else null end) - } + } | discard_binary_sha256($config[0].binary_sha256_discard) ] | sort_by(.binary_path) diff --git a/profile/profile-config.json b/profile/profile-config.json index da5ec9f..493ec9f 100644 --- a/profile/profile-config.json +++ b/profile/profile-config.json @@ -13,5 +13,7 @@ ], "dns_discard": [ "pipelines.actions.githubusercontent.com" + ], + "binary_sha256_discard":[ ] }