Skip to content

Commit 48b36fd

Browse files
committed
add script for maintainer to build CHANGELOG entries
1 parent c19052a commit 48b36fd

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

CHANGELOG.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,3 @@
33
All notable changes to this project will be documented in this file.
44

55
> **Note:** This CHANGELOG was created starting from version 0.12.0. Earlier changes are not documented here.
6-
7-
## Unreleased
8-
9-
## 0.11.0 - 2024-08-20
10-
11-
- Initial CHANGELOG implementation ([#465](https://github.com/aws-observability/aws-otel-python-instrumentation/pull/465))

scripts/draft-changelog.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash -e
2+
3+
# Find the latest release tag that's in the current branch's history
4+
latest_tag=""
5+
for tag in $(git tag -l "v*.*.*" --sort=-version:refname); do
6+
if git merge-base --is-ancestor "$tag" HEAD; then
7+
latest_tag="$tag"
8+
break
9+
fi
10+
done
11+
12+
if [[ -z $latest_tag ]]; then
13+
echo "No release tags found in current branch history"
14+
exit 1
15+
fi
16+
17+
echo "# Changes since $latest_tag:"
18+
echo
19+
20+
# Generate changelog entries from commits since the tag
21+
git log --reverse \
22+
--perl-regexp \
23+
--author='^(?!dependabot\[bot\] )(?!github-actions\[bot\] )' \
24+
--pretty=format:"- %s" \
25+
"$latest_tag..HEAD" \
26+
| grep -E '\(#[0-9]+\)$' \
27+
| grep -v '^- Post release ' \
28+
| sed -E 's,\(#([0-9]+)\)$, ([#\1](https://github.com/aws-observability/aws-otel-python-instrumentation/pull/\1)),'

0 commit comments

Comments
 (0)