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] Naming labels based on regex capture groups #59

Open
illrill opened this issue Feb 15, 2023 · 1 comment
Open

[Feature] Naming labels based on regex capture groups #59

illrill opened this issue Feb 15, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@illrill
Copy link

illrill commented Feb 15, 2023

This feature request is for the ability to use regex capture groups to name the labels dynamically.


Imagine the following repository folder structure and I want all PR's to have an area/<area> label, which value should be based on the subfolder that the PR brings changes to.

k8s/ingress/...
k8s/rbac/...
k8s/config/...
k8s/dns/...
k8s/istio/...
network/...

Currently, I need to configure each possible label manually:

labels:
- label: "area/k8s-ingress"
  files:
  - "k8s/ingress/.*"
- label: "area/k8s-rbac"
  files:
  - "k8s/rbac/.*"
- label: "area/k8s-config"
  files:
  - "k8s/config/.*"
- label: "area/k8s-dns"
  files:
  - "k8s/dns/.*"
- label: "area/k8s-istio"
  files:
  - "k8s/istio/.*"
- label: "area/network"
  files:
  - "network/.*"

With the ability to use regex capture groups to name the labels dynamically, my configuration could be reduced to:

labels:
- label: "area/k8s-$1"
  files:
  - "k8s/(.*)/.*"
- label: "area/network"
  files:
  - "network/.*"

Nice to see that your back at it and releasing new features @srvaroa 🔥We love this project in our team.

@srvaroa srvaroa added the enhancement New feature or request label Feb 15, 2023
@srvaroa
Copy link
Owner

srvaroa commented Feb 15, 2023

Thanks @illrill, glad you're finding it useful. Looks like a good feature!

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

2 participants