aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/changelog-links.sh
diff options
context:
space:
mode:
authorAlexandre Garand <alexandre.garand@fretlink.com>2019-07-04 13:31:58 +0200
committerAlexandre Garand <alexandre.garand@fretlink.com>2019-07-04 14:25:40 +0200
commita1f9b9a1c1a80ee4db8de66fe1b771fe8e28cd05 (patch)
tree2841fe577e2927dc4b0e9df04c7535c9fb8d31de /scripts/changelog-links.sh
parentdd1186fd91ca40f876130a596f53ebef14cf8815 (diff)
downloadterraform-provider-mailgun-a1f9b9a1c1a80ee4db8de66fe1b771fe8e28cd05.tar.gz
terraform-provider-mailgun-a1f9b9a1c1a80ee4db8de66fe1b771fe8e28cd05.tar.zst
terraform-provider-mailgun-a1f9b9a1c1a80ee4db8de66fe1b771fe8e28cd05.zip
add doc
Diffstat (limited to 'scripts/changelog-links.sh')
-rwxr-xr-xscripts/changelog-links.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/scripts/changelog-links.sh b/scripts/changelog-links.sh
new file mode 100755
index 0000000..303341b
--- /dev/null
+++ b/scripts/changelog-links.sh
@@ -0,0 +1,31 @@
1#!/bin/bash
2
3# This script rewrites [GH-nnnn]-style references in the CHANGELOG.md file to
4# be Markdown links to the given github issues.
5#
6# This is run during releases so that the issue references in all of the
7# released items are presented as clickable links, but we can just use the
8# easy [GH-nnnn] shorthand for quickly adding items to the "Unrelease" section
9# while merging things between releases.
10
11set -e
12
13if [[ ! -f CHANGELOG.md ]]; then
14 echo "ERROR: CHANGELOG.md not found in pwd."
15 echo "Please run this from the root of the terraform provider repository"
16 exit 1
17fi
18
19if [[ `uname` == "Darwin" ]]; then
20 echo "Using BSD sed"
21 SED="sed -i.bak -E -e"
22else
23 echo "Using GNU sed"
24 SED="sed -i.bak -r -e"
25fi
26
27PROVIDER_URL="https:\/\/github.com\/terraform-providers\/terraform-provider-statuscake\/issues"
28
29$SED "s/GH-([0-9]+)/\[#\1\]\($PROVIDER_URL\/\1\)/g" -e 's/\[\[#(.+)([0-9])\)]$/(\[#\1\2))/g' CHANGELOG.md
30
31rm CHANGELOG.md.bak