We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Description: We have a directory structure in our repo which looks like this:
k8s |-> services |-> analytics |-> catalog |-> consul ...
It would be great if I could define a "matcher" pattern that could pull part of the path out, and use that in the label name.
k8s/service/[service]: - k8s/services/**[service]/*
Justification:
This would give us a way to automatically label services without having to remember to update the labeler.yml file each time we add a new path.
labeler.yml
Are you willing to submit a PR? Don't have time right now, just an idea.
The text was updated successfully, but these errors were encountered:
Hello @mwarkentin! Thank you! We will consider adding this feature and will contact you as soon as we have any updates!
Sorry, something went wrong.
@mwarkentin we were looking into a similar issue where we wanted labels based on folders
Temporarily solved it like this until some future version of labeler presents a better option
- name: Update labeler.yml run: | find infrastructure -type d | grep -v '/\.' | awk -F'/' 'NF>2' | jq -R -s -c 'split("\n")[:-1]' > folders.json touch ${{ env.yamlfile }} echo "Add defaults to ${{ env.yamlfile }}" cat > ${{ env.yamlfile }} << EOF workflow-change: - changed-files: - any-glob-to-any-file: '.github/workflows/*' EOF echo "Add dynamic folder labels to ${{ env.yamlfile }}" jq -r '.[] | select(startswith("infrastructure"))' folders.json | while read folder; do label="${folder#infrastructure/}" label="${label//\//-}" label="${label//production/prd}" label="${label//staging/stg}" if [ "${#label}" -gt 63 ]; then echo "Label is longer than 63 characters: $label" label="${label:0:63}" echo "Trimmed label to 63 characters: $label" else echo "- $folder -> $label" fi echo "- $folder -> $label" cat >> ${{ env.yamlfile }} << EOF $label: - changed-files: - any-glob-to-any-file: '$folder/*' EOF done echo "Output file" cat ${{ env.yamlfile }} shell: bash - uses: actions/labeler@v5 with: sync-labels: true
Could probably be cleaned up a bit more, but it does its job for now
No branches or pull requests
Description:
We have a directory structure in our repo which looks like this:
It would be great if I could define a "matcher" pattern that could pull part of the path out, and use that in the label name.
Justification:
This would give us a way to automatically label services without having to remember to update the
labeler.yml
file each time we add a new path.Are you willing to submit a PR?
Don't have time right now, just an idea.
The text was updated successfully, but these errors were encountered: