-
Notifications
You must be signed in to change notification settings - Fork 269
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
Ability to filter out shared yaml anchors from changes
output?
#131
Comments
Do you happen to have any updates/workaround on this? |
@lucasyarid I ended up passing the output to a JS script to filter out undesired output. |
Having the same issue here. This is a workaround using changes:
runs-on: ubuntu-latest
outputs:
services: ${{ steps.filter_shared.outputs.without-shared }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
shared: &shared
- 'something/**'
- 'foo/bar/baz/**'
service1:
- *shared
- 'foo/bar/**'
service2:
- *shared
- 'baz/**'
# filter out "shared" from services
- name: Filter shared
id: filter_shared
run: |
echo "without-shared=$(echo '${{ steps.filter.outputs.changes }}' | jq -c 'map(select(. != "shared"))')" >> $GITHUB_OUTPUT |
Finally found some time to open a PR to fix the issue. |
YAML anchors are great for shared config, but if you're trying to use the
changes
output to drive the matrix of another job, then any anchors you use (which are required by YAML to be attached to a YAML object declaration) are themselves going to appear in the list ofchanges
, e.g.Assuming I only want matrix jobs for
src
andlib
, this will produced the undesired result of also addingshared
to the changes array, which will generate a job forshared
even thoughshared
is only meant to be used as a yaml mixin. Is there any way to filter this out?The text was updated successfully, but these errors were encountered: