Skip to content

Commit 84593d3

Browse files
authored
release: Fix changelog generator broken link (#367)
Fixes the interpolated version for the release document in the GitHub release to equal to `$MAJOR.MINOR` rather than the whole version string. Signed-off-by: Marc Lopez <marc5.12@outlook.com>
1 parent 9f33b6f commit 84593d3

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

scripts/changelog.tpl.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ Checksums are at [ecctl_VERSION_REPLACE_checksums.txt](https://download.elastic.
1616

1717
## Release notes
1818

19-
<https://www.elastic.co/guide/en/ecctl/vVERSION_REPLACE/ecctl-release-notes-vVERSION_REPLACE.html>
19+
<https://www.elastic.co/guide/en/ecctl/VERSION_CROPPED_REPLACE/ecctl-release-notes-vVERSION_REPLACE.html>

scripts/generate-changelog.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,21 @@ if [[ $(git status) == *"Your branch is behind"* ]]; then
66
fi
77

88
git fetch
9-
PREV_TAG=$(git tag -l | tail -1)
9+
PREV_TAG=$(git tag -l 'v[0-9-]*.[0-9-]*.[0-9-]'| tail -1)
1010
CHANGELOGFILE=notes/${VERSION}.md
1111
ADOC_CHANGELOG=docs/release_notes/${VERSION}.adoc
1212
ADOC_CHANGELOG_HISTORY=docs/ecctl-release-notes.asciidoc
1313

1414
if [[ -z ${PREV_TAG} ]]; then echo "-> Exiting changelog generation since there's no previous tag"; exit 0; fi
1515

16+
MAJORMINOR="$(echo ${VERSION} | tr -d 'v' |cut -d '.' -f1).$(echo $VERSION | tr -d 'v' |cut -d '.' -f2)"
17+
1618
echo "=> Attempting to generate the changelog for release ${VERSION}..."
1719
read -p "=> Previous release was ${PREV_TAG}, is that correct? " -n 1 -r
1820

1921
if [[ ${REPLY} =~ ^[Yy]$ ]]; then
2022
echo ""
21-
sed "s/VERSION_REPLACE/$(echo ${VERSION}| sed 's/^v//')/g" scripts/changelog.tpl.md > ${CHANGELOGFILE}
23+
sed "s/VERSION_REPLACE/$(echo ${VERSION}| sed 's/^v//')/g" scripts/changelog.tpl.md | sed "s/VERSION_CROPPED_REPLACE/${MAJORMINOR}/" > ${CHANGELOGFILE}
2224
sed "s/VERSION_REPLACE/$(echo ${VERSION}| sed 's/^v//')/g" scripts/changelog.tpl.adoc > ${ADOC_CHANGELOG}
2325

2426
git -c log.showSignature=false log --pretty="https://github.com/elastic/ecctl/commit/%h[%h] %s" --no-decorate --no-color tags/${PREV_TAG}..master |\

0 commit comments

Comments
 (0)