labeler: Cannot represent matching all files against multiple patterns

The use-case seems like it would be quite useful and natural: I would like a label to apply if ALL of the changed files are of a few certain types. For example:

documentation:
  - all: ["**/*.md", "**/*.puml"]

This of course doesn’t work as all files need to match both patterns which never happens. Another attempt:

documentation:
  - all: ["**/*.md"]
  - all: ["**/*.puml"]

This almost works but does not work if the change touches both md files and puml files.

AFAICT there is no way to represent what I’m trying to do, but it feels like a very natural and useful case to support.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (12 by maintainers)

Commits related to this issue

Most upvoted comments

Looks like you’re right. I’d be up for renaming AnyGlobMatchesAllFiles to OneGlobMatchesAllFiles since that’s what it does. Unless these semantics were used by mistake. I suspect the latter, because the current misnamed OneGlobMatchesAllFiles semantics could be implemented without it, in terms of AllGlobsMatchAllFiles, like:

- any
  - changed-files
    - all-globs-to-all-files: ['glob1']
    - all-globs-to-all-files: ['glob2']
    - all-globs-to-all-files: ['glob3']

whereas the reverse is not true. There is no way to implement AnyGlobMatchesAllFiles (the real one) in terms of the others.

Hello everyone! We have released the new major version of the action that includes the implementation of this feature. Please read the action documentation to find out how to adapt your configuration files and workflows for use with the new action version.

Thank you all for your patience! Do not hesitate to contact us if you have any questions!

Just so it’s explicitly clear, I have PR #487 outstanding that adds this feature.

My reading of the documentation is that that example is the same as:

documentation:
  - any: ["**/*.md"]
  - any: ["**/*.puml"]

This would add the documentation label to a PR consisting of 99 .c files and one .md file, which is not the intention.