mirror of
https://github.com/msoedov/agentic_security.git
synced 2026-08-09 03:06:05 +02:00
feat(add changelog sh):
This commit is contained in:
@@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Get the last tag
|
||||||
|
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null)
|
||||||
|
|
||||||
|
if [ -z "$LAST_TAG" ]; then
|
||||||
|
echo "No tags found. Retrieving all commits."
|
||||||
|
LOG_RANGE="HEAD"
|
||||||
|
else
|
||||||
|
echo "Generating changelog from last tag: $LAST_TAG"
|
||||||
|
LOG_RANGE="$LAST_TAG..HEAD"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Retrieve commit messages excluding merge commits and format them with author names and stripped email domain as nickname
|
||||||
|
CHANGELOG=$(git log --pretty=format:"- %s by %an, @%ae)" --no-merges $LOG_RANGE | sed -E 's/@([^@]+)@([^@]+)\..*/@\1/')
|
||||||
|
|
||||||
|
# Output the changelog
|
||||||
|
if [ -n "$CHANGELOG" ]; then
|
||||||
|
echo "# Changelog"
|
||||||
|
echo "
|
||||||
|
## Changes since $LAST_TAG"
|
||||||
|
echo "$CHANGELOG"
|
||||||
|
else
|
||||||
|
echo "No new commits since last tag."
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user