Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Feat): Add support for negative tag filters #14

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading