Skip to content

Commit

Permalink
(Feat): Add support for negative tag filters
Browse files Browse the repository at this point in the history
  • Loading branch information
pat-trunk-io committed Dec 12, 2023
1 parent 99f2205 commit 86adda9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ inputs:
description: Negative scope filter to apply to impacted targets
required: false
default: //external
test-negative-tag-filter:
description: Negative tag filter to apply to impacted targets
required: false

runs:
using: composite
Expand Down Expand Up @@ -171,4 +174,5 @@ runs:
BAZEL_SCOPE_FILTER: ${{ inputs.test-scope-filter }}
BAZEL_NEGATIVE_KIND_FILTER: ${{ inputs.test-negative-kind-filter }}
BAZEL_NEGATIVE_SCOPE_FILTER: ${{ inputs.test-negative-scope-filter }}
BAZEL_NEGATIVE_TAG_FILTER: ${{ inputs.test-negative-tag-filter }}
CI: "true"
3 changes: 3 additions & 0 deletions src/scripts/test_impacted_targets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ fi
echo "let targets = kind('${BAZEL_KIND_FILTER}', \$targets) in" >&3
# trunk-ignore(shellcheck/SC2016)
echo '$targets' >&3
if [[ -n ${BAZEL_NEGATIVE_TAG_FILTER} ]]; then
echo "- attr('tags', '${BAZEL_NEGATIVE_TAG_FILTER}', \$targets)" >&3
fi
if [[ -n ${BAZEL_NEGATIVE_KIND_FILTER} ]]; then
echo "- kind('${BAZEL_NEGATIVE_KIND_FILTER}', \$targets)" >&3
fi
Expand Down

0 comments on commit 86adda9

Please sign in to comment.