Skip to main content

Allow partial wildcard matching on autoattaching policies

The auto-attachment feature (https://docs.spacelift.io/concepts/configuration/context#auto-attachments) currently supports using a “*” to match all projects. It would be nice if it could be used to match a partial subset of projects.

For example, if I have projects with labels of:

  1. team/X/project_1

  2. team/X/project_2

  3. team/Y/project_1

I would like to be able to set “autoattach:team/X/*” and have it autoattach to only projects with a label that starts with “team/X/”.

Workaround
Status: ⬆️ Gathering votes2 comments

Log in to comment and vote

Comments2

  • Red Pudding

    •

    Mar 4

    Would be nice to have this feature! We’re currently working on some contexts with hooks for hundreds of stacks and it would be nice to not have to relabel everything to accomplish this.

  • Natalia Gazda

    Team•

    Aug 7, 2025

    Thanks for the feedback, @David Lo .

    I can see how partial wildcard matching would help organize contexts across team hierarchies.Currently, you're correct that auto-attachment only supports exact label matches or the full wildcard (*). Your workaround of manually specifying each label is indeed the way to handle this today. I understand this would be a nice quality-of-life improvement.

    The existing auto-attachment system, combined with the Terraform provider for programmatic management, addresses most organizational needs at scale.

    For your specific use case, you might consider using the Spacelift Terraform provider to programmatically generate the auto-attachment labels based on your team structure. This would give you the same outcome with more explicit control.

    I've noted your feedback and will leave it in gathering votes for now, to see the interest among other customers.

    Thanks for taking the time to share this suggestion!