From 94ff15fe5b95f3635de3843c8efa1282f99dbfe3 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Wed, 24 Feb 2016 17:34:14 -0800 Subject: [PATCH] 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. --- scripts/changelog-links.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 scripts/changelog-links.sh diff --git a/scripts/changelog-links.sh b/scripts/changelog-links.sh new file mode 100755 index 000000000..1799d9fcc --- /dev/null +++ b/scripts/changelog-links.sh @@ -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