Skip to content

Commit

Permalink
Merge pull request #42 from josedonizetti/add-binary-sha-discard
Browse files Browse the repository at this point in the history
add binary_sha discard
  • Loading branch information
josedonizetti committed Jan 30, 2023
2 parents 0298d95 + 8bb5d42 commit 265492c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion profile/exec.jq
Original file line number Diff line number Diff line change
Expand Up @@ -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;

[
.[] |
{
Expand All @@ -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)
2 changes: 2 additions & 0 deletions profile/profile-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@
],
"dns_discard": [
"pipelines.actions.githubusercontent.com"
],
"binary_sha256_discard":[
]
}

0 comments on commit 265492c

Please sign in to comment.