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

[Feature] add exclusion(!) support for yaml anchor #2186

Closed
1 task done
sliu-circle opened this issue Jul 8, 2024 · 2 comments
Closed
1 task done

[Feature] add exclusion(!) support for yaml anchor #2186

sliu-circle opened this issue Jul 8, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@sliu-circle
Copy link

sliu-circle commented Jul 8, 2024

Is this feature missing in the latest version?

  • I'm using the latest release

Is your feature request related to a problem? Please describe.

Example of changed-files.yml

part_a: &part_a
  - pattern_a
part_b: &part_b
  - pattern_b
part_c: 
  - !*part_a
  - !*part_b

Describe the solution you'd like?

Add exclusion(!) support for yaml anchor

@sliu-circle sliu-circle added the enhancement New feature or request label Jul 8, 2024
@tj-actions-bot
Copy link
Contributor

Thanks for reporting this issue, don't forget to star this project if you haven't already to help us reach a wider audience.

@jackton1
Copy link
Member

HI @sliu-circle, YAML anchors and aliases do not directly support exclusion or negation. YAML anchors (&) and aliases (*) are primarily used to reuse and reference nodes within the YAML document.

You can however define an anchor that includes negation patterns instead

not_part_a: &not_part_a
  - '!pattern_a'
not_part_b: &not_part_b
  - '!pattern_b'
part_c: 
  - *not_part_a
  - *not_part_b

@jackton1 jackton1 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants