Open oleksandr-kinship opened 10 months ago
@oleksandr-kinship
I had the same problem recently, but it seems that the negation operator is not supported. Please also check the following related issue
I'd be happy if it's the same as GitHub's paths.
@oleksandr-kinship
I had the same problem recently, but it seems that the negation operator is not supported. Please also check the following related issue
I'd be happy if it's the same as GitHub's paths.
Thanks, it works for single rule but not in combination.. so I was tried another action, for me in general it's less comfortable, but at least it works fine so far, here is example
- name: Get changes
uses: tj-actions/changed-files@v38
id: changes
with:
files_yaml: |
non-infra:
- '!.github/**'
- '!infrastructure/**'
- name: Log non-infra changes
shell: bash
run: |
echo "Is there changes for non-infra: ${{ steps.changes.outputs.non-infra_any_changed}}"
echo "List of all non-infra changed files: ${{ steps.changes.outputs.non-infra_all_changed_files }}"
It appears that !foo
is returning a list of files from the entire folder that do not match foo
, instead of culling the existing filepaths from other lines. The underlying minimatch
/picomatch
libs are working as expected.
In our case, our filter was previously
- 'app-*/**'
- '!app-ui/**'
but I'm pretty sure that resulted in a union of:
app-*/**
(including app-ui
)resulting in a file list that includes everything in the folder as triggering a rebuild.
Instead, we changed to
- 'app-!(ui)/**'
which is what we wanted. That syntax is described on picomatch
's docs, which is what this action uses.
Quick other note: make sure to put the strings in quotes since YAML treats *
, !
and &
and whatnot as special characters (anchors, tags, etc.)
Hey, have repo that include two folders, for which I don't want to run some steps, tried following:
Got this results:
ga
andinfra
looks good, expected that some folders not match, but inga-infra
I expected to see onlysrc/main/java/com/.../file.java
because other excluded Can you point me what I did wrong or this not possible to implement, tried to readpicomatch
not get answers ..