Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5acddbc7c6 | |||
|
bfa7280ab3
|
|||
| 351303db0f | |||
|
e8426bb839
|
|||
| bb6e1d44b8 | |||
|
f54df9fbc4
|
|||
| f1541e7d5d | |||
|
65462f5a14
|
14
CHANGELOG.md
14
CHANGELOG.md
@@ -2,6 +2,20 @@
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## [1.1.0](https://git.0xmax42.io/actions/auto-changelog-release-action/compare/v1.0.1..v1.1.0) - 2025-09-29
|
||||
|
||||
### 🚀 Features
|
||||
|
||||
- *(scripts)* Add type extraction and mismatch detection logic - ([e8426bb](https://git.0xmax42.io/actions/auto-changelog-release-action/commit/e8426bb839dd29f807f232efe5f7bf829ec4f9f1))
|
||||
|
||||
### 📚 Documentation
|
||||
|
||||
- Add changelog improvement ideas to TODO file - ([f54df9f](https://git.0xmax42.io/actions/auto-changelog-release-action/commit/f54df9fbc42e3fc453042a1f2c36f7cd12e38c41))
|
||||
|
||||
### ⚙️ Miscellaneous Tasks
|
||||
|
||||
- *(config)* Improve child commit handling in merge template - ([65462f5](https://git.0xmax42.io/actions/auto-changelog-release-action/commit/65462f5a1495aa45afd727a962126db953ab75a5))
|
||||
|
||||
## [1.0.1](https://git.0xmax42.io/actions/auto-changelog-release-action/compare/v1.0.0..v1.0.1) - 2025-09-27
|
||||
|
||||
### ⚙️ Miscellaneous Tasks
|
||||
|
||||
46
TODO.md
Normal file
46
TODO.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# TODO
|
||||
|
||||
## Git-Cliff / Changelog Improvements
|
||||
|
||||
### Idea: Use Merge Commit Body as Documentation
|
||||
|
||||
* **Context**: Normally, only the commit subject is included in changelogs.
|
||||
* **Idea**: Treat merge commits as *project documentation*.
|
||||
|
||||
* The subject line = headline of the feature / branch.
|
||||
* The body = narrative explanation of what the branch accomplished.
|
||||
* Child commits = detailed steps, already included under the merge.
|
||||
|
||||
### Benefits
|
||||
|
||||
* Provides more context for each feature branch.
|
||||
* Turns the changelog into a lightweight project documentation.
|
||||
* Keeps individual commits small and clean while still showing the bigger picture.
|
||||
* Optional: if no body is present, nothing changes.
|
||||
|
||||
### Possible Implementation
|
||||
|
||||
* In the changelog template:
|
||||
|
||||
* Detect merge commits.
|
||||
* Render `commit.body` below the subject line.
|
||||
* Indent and format properly (e.g. bullet points preserved).
|
||||
|
||||
### Example
|
||||
|
||||
```
|
||||
### 🚀 Features
|
||||
|
||||
- 🔀 **Merge branch 'feature/oauth2'** - ([abc1234](...))
|
||||
Add OAuth2 login flow with full explanation of scope:
|
||||
- why OAuth2 was chosen
|
||||
- compatibility with existing login
|
||||
- possible future extensions
|
||||
|
||||
- *(auth)* Add login endpoint - ([def5678](...))
|
||||
- *(auth)* Implement token exchange - ([ghi9012](...))
|
||||
- *(auth)* Add error handling - ([jkl3456](...))
|
||||
- *(test)* Add unit tests for OAuth2 flow - ([mno7890](...))
|
||||
```
|
||||
|
||||
---
|
||||
@@ -40,12 +40,14 @@ body = """
|
||||
{% if commit.merge_commit %}\
|
||||
- 🔀 **{{ commit.message | upper_first }}** - \
|
||||
([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\
|
||||
{% if commit.extra and commit.extra.children %}\
|
||||
{% for child in commit.extra.children %}
|
||||
{{ " " | safe }}- {% if child.scope %}*({{ child.scope }})* {% endif %}\
|
||||
{% if child.breaking %}[**breaking**] {% endif %}\
|
||||
{{ child.message | upper_first }} - \
|
||||
([{{ child.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ child.id }}))\
|
||||
{% endfor %}\
|
||||
{% endif %}\
|
||||
{% else %}\
|
||||
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
|
||||
{% if commit.breaking %}[**breaking**] {% endif %}\
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
import json
|
||||
import subprocess
|
||||
import sys
|
||||
import re
|
||||
|
||||
def extract_type(raw_message: str) -> str | None:
|
||||
m = re.match(r"^(\w+)(?:\([^)]+\))?:", raw_message.strip())
|
||||
return m.group(1) if m else None
|
||||
|
||||
def git_commits_between(parent, merge):
|
||||
"""Return list of commit hashes between parent and merge (exclusive of parent, inclusive of merge)."""
|
||||
@@ -34,6 +39,8 @@ def main(path=None):
|
||||
).strip().split()
|
||||
merge_id, *parent_ids = parents
|
||||
|
||||
parent_type = extract_type(c["raw_message"])
|
||||
|
||||
if len(parent_ids) >= 2:
|
||||
mainline = parent_ids[0]
|
||||
children_ids = git_commits_between(mainline, merge_id)
|
||||
@@ -41,7 +48,13 @@ def main(path=None):
|
||||
children = []
|
||||
for cid in children_ids:
|
||||
if cid in commits_by_id:
|
||||
children.append(commits_by_id[cid])
|
||||
child = commits_by_id[cid]
|
||||
child_type = extract_type(child["raw_message"])
|
||||
if child_type and parent_type and child_type != parent_type:
|
||||
if not child.get("extra") or not isinstance(child["extra"], dict):
|
||||
child["extra"] = {}
|
||||
child["extra"]["mismatch_type"] = child_type
|
||||
children.append(child)
|
||||
consumed.add(cid)
|
||||
|
||||
if not c.get("extra") or not isinstance(c["extra"], dict):
|
||||
|
||||
Reference in New Issue
Block a user