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

filter out shared from yaml anchor output #239

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lucasyarid
Copy link

fixes #131

This PR fixes the github actions changes output when using the proposed shared YAML anchor.
There are unit tests for it but please do propose the correct standards.

@lucasyarid lucasyarid force-pushed the filter-out-shared branch 2 times, most recently from 43087fb to 5ab3a8d Compare May 17, 2024 09:45
@machty
Copy link

machty commented May 17, 2024

If I understand correctly, I think it's a bit weird for this logic to be based on the magic keyword "shared", but should rather be based on whether the yaml entry has an & anchor.

In other words it should be possible to have two (or more) different share-able anchored entries that don't trigger a build themselves but can be included as part of other entries.

@lucasyarid
Copy link
Author

If I understand correctly, I think it's a bit weird for this logic to be based on the magic keyword "shared", but should rather be based on whether the yaml entry has an & anchor.

In other words it should be possible to have two (or more) different share-able anchored entries that don't trigger a build themselves but can be included as part of other entries.

Agreed, but struggling to find how can I export this data from js-yaml.

@machty
Copy link

machty commented May 17, 2024

I'm not sure either (unfortunately don't have time to dig in).

At work we have a pnpm workspace / monorepo and one of the subprojects is called "shared"; even though this wouldn't bite us in our current setup, it's easy to imagine getting bitten by this magic keyword if building a file filter to determine when to run "shared" CI jobs.

@lucasyarid
Copy link
Author

@machty doesn't seem possible in js-yaml so we are a bit stuck here.
The only other way I figured is to have another input in the actions passing a list of "shared" keys and TBH this looks overkill and better to just filter outside as you are currently doing.

I'll park this PR awaiting any suggestions but gonna have to eventually close it as I agree filtering just for shared is not the best approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to filter out shared yaml anchors from changes output?
2 participants