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

Support reusable paths blocks via yaml anchors #13

Merged
merged 4 commits into from Jun 19, 2020
Merged

Conversation

dorny
Copy link
Owner

@dorny dorny commented Jun 19, 2020

YAML already supports anchors as a way to avoid copy-pasting repeated parts of the document.
This could be used to embed some rule (i.e. list of paths expressions) into another rule.
It's a more ergonomic alternative to checking several rules with || operator inside workflow if statement.

YAML anchors however doesn't allow merging of lists.
If we use anchor to embed another rule, we actually get a nested list.
This PR implements flattening of the rule paths expressions, which enables usage of anchros.

Fixes #12

@dorny dorny merged commit 7d20182 into master Jun 19, 2020
@dorny dorny deleted the support-yaml-anchors branch June 19, 2020 21:39
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.

Use recursive rules
1 participant