Move and improve change log script
ADD
.github/scripts/draft-change-log-entries.sh
+#!/bin/bash -e
+
+version=$(grep -Eo "[0-9]+.[0-9]+.0" version.gradle.kts | head -1)
+
+if [[ $version =~ ([0-9]+).([0-9]+).0 ]]; then
+ major="${BASH_REMATCH[1]}"
+ minor="${BASH_REMATCH[2]}"
+else
+ echo "unexpected version: $version"
+ exit 1
+fi
+
+if [[ $minor == 0 ]]; then
+ prior_major=$((major - 1))
+ prior_minor=$(grep -Po "^## Version $prior_major.\K([0-9]+)" CHANGELOG.md | head -1)
+ prior_version="$prior_major.$prior_minor"
+else
+ prior_version="$major.$((minor - 1)).0"
+fi
+
+git log --reverse --pretty=format:"- %s" "v$prior_version"..HEAD \
+ | sed -r 's,\(#([0-9]+)\),\n ([#\1](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/\1)),'

MODIFY
RELEASING.md
RELEASING.md
@@ -16,6 +16,8 @@ as the last step, which publishes a snapshot build to
* Merge a pull request to `main` updating the `CHANGELOG.md`.
* The heading for the release should include the release version but not the release date, e.g.
`## Version 1.9.0 (unreleased)`.
+ * Use `.github/scripts/draft-change-log-entries.sh` as a starting point for writing the change
+ log.
* Run the [Prepare release branch workflow](.github/workflows/prepare-release-branch.yml).
* Review and merge the two pull requests that it creates
(one is targeted to the release branch and one is targeted to the `main` branch).

DELETE
buildscripts/draft-change-log-entries.sh
-#!/bin/bash -e
-
-git log --reverse --pretty=format:"- %s" "$1"..HEAD \
- | sed -r 's,\(#([0-9]+)\),\n ([#\1](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/\1)),'
-echo

Move and improve change log script (#5845)