Skip to content

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

@illrill

Description

@illrill

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions