diff --git a/cliff.toml b/cliff.toml index 755df45..46b2e2c 100644 --- a/cliff.toml +++ b/cliff.toml @@ -25,8 +25,26 @@ body = """ - {% if commit.scope %}*({{ commit.scope }})* {% endif %}\ {% if commit.breaking %}[**breaking**] {% endif %}\ {{ commit.message | upper_first }}\ + {%- for footer in commit.footers -%} + {%- if footer.token == "Assisted-by" %} *(🤖 {{ footer.value | trim }})*{%- endif -%} + {%- endfor %}\ {% endfor %} -{% endfor %}\n +{% endfor %} + +{%- set ai_models = [] -%} +{%- for commit in commits -%} + {%- for footer in commit.footers -%} + {%- if footer.token == "Assisted-by" -%} + {%- set_global ai_models = ai_models | concat(with=footer) -%} + {%- endif -%} + {%- endfor -%} +{%- endfor -%} +{%- if ai_models | length > 0 %} + ### 🤖 AI Assistance Repartition + {%- for model, occurrences in ai_models | group_by(attribute="value") %} + - **{{ model | trim }}**: {{ occurrences | length }} commit{% if occurrences | length > 1 %}s{% endif %} + {%- endfor %} +{% endif %}\n """ # template for the changelog footer footer = """