Using Kind label instead of key in templated output? #698
-
Trying this... footerFormat: |
{{- $seen := dict -}}
{{- $sortedKeys := list -}}
{{- range .Changes -}}
{{/* printf "%v+\n" . */}}
{{- $key := printf "%s|%s" .Kind .Body -}}
{{- $sortedKeys = append $sortedKeys $key -}}
{{- end -}}
{{- $sortedKeys = sortAlpha $sortedKeys -}}
{{- range $sortedKeys -}}
{{- $split := splitList "|" . -}}
{{- $kind := index $split 0 -}}
{{- $body := index $split 1 -}}
{{- $key := printf "%s|%s" $kind $body -}}
{{- if not (hasKey $seen $key) -}}
{{- $_ := set $seen $key true }}
- _{{ $kind }}_: {{ $body -}}
{{ end -}}
{{- end -}}
kindFormat: ''
changeFormat: ''
Kind:
skipGlobalChoices: true
kinds:
- label: ✨ New Feature
key: new-feature
auto: minor
- label: 🔨 Parameter Change (Optional)
key: parameter-change-optional
auto: minor
- label: 🐛 Bug Fix
key: bug-fix
auto: patch This produces output like this: - _dependencies_: Renovate update major: terraform-provider azurerm.
- _dependencies_: Renovate update minor: git-tags azure-pipeline-templates.
- _dependencies_: Renovate update minor: github-releases aquaproj/aqua-registry. What I would expect - _🐛 Bug Fix_: Renovate update major: terraform-provider azurerm.
- _🐛 Bug Fix_: Renovate update minor: git-tags azure-pipeline-templates.
- _🐛 Bug Fix_: Renovate update minor: github-releases aquaproj/aqua-registry. Still not seeing Kind label in either changeFormat or footer work with the label, only seems to use the key value. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hmm I believe the kind key under batch data is returning the kind key specifically. I don't think the template funcs have really been upgraded since we created a separate kind key from the kind label. Even the kinds template func seems a bit lacking. I think we need a few more options here. Maybe a kind configs template func, and a kind label value under batch data. Maybe even a kind key that is an alias for kind but more specific. |
Beta Was this translation helpful? Give feedback.
Moved the request to a new issue/PR here #708, if you swap
.Kind
with.KindLabel
I believe you are good to go.