Skip to content
This repository was archived by the owner on Jun 25, 2024. It is now read-only.
This repository was archived by the owner on Jun 25, 2024. It is now read-only.

Support all glob path patterns #136

@cycraig

Description

@cycraig

Description

Only * and ** work when used in a path trigger. It would be nice to use curly braces too.

Curly brace patterns are supported by doublestar (the library used for */** in this repo), and actually work currently, but only if the path includes * too.

Example

steps:
  - label: "Triggering pipelines with glob paths"
    plugins:
      - monebag/monorepo-diff#v2.5.9:
          diff: "git diff --name-only HEAD~1"
          watch:
            - path:
                - "rust/**/*.{rs,toml,lock}" # works
                - "rust/{foo,bar}/*.{rs,sql}" # works
                - "scripts/{git-diff,install-rust}.sh" # fails, no trigger
              config:
                command: "cargo check"

Suggestion

I believe this is the relevant code? Maybe it's sufficient to check for pairs of brackets too?

This is probably a breaking change, since existing path triggers containing brackets {}/[] might behave differently (if those paths don't contain *).

https://github.com/monebag/monorepo-diff-buildkite-plugin/blob/3f65d099261bf9680da137cc4cabc363bcabcb8d/pipeline.go#L120-L125

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions