Script to linkify github issue references in CHANGELOG.md

This fixes #4439 by making a compromise: the issues under the "unreleased"
heading will still not be links, because it's inconvenient for the
committers team to write out those links manually for each merge. However,
we'll run this script on release so that all of the *released* changes
are presented as clickable links, so people can quickly read through the
set of changes in each new release.
This commit is contained in:
Martin Atkins 2016-02-24 17:34:14 -08:00
parent 5444223da3
commit 94ff15fe5b
1 changed files with 16 additions and 0 deletions

16
scripts/changelog-links.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
# This script rewrites [GH-nnnn]-style references in the CHANGELOG.md file to
# be Markdown links to the given github issues.
#
# This is run during releases so that the issue references in all of the
# released items are presented as clickable links, but we can just use the
# easy [GH-nnnn] shorthand for quickly adding items to the "Unrelease" section
# while merging things between releases.
set -e
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
cd "$SCRIPT_DIR/.."
sed -ri 's/\[GH-([0-9]+)\]/\(\[#\1\]\(https:\/\/github.com\/hashicorp\/terraform\/issues\/\1\)\)/' CHANGELOG.md