-
Notifications
You must be signed in to change notification settings - Fork 303
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update CHANGELOG.md for #1585 include #1585 * Update CHANGELOG.md pulling in changes from duplicate changelog PR * Update CHANGELOG.md for #1619 * Update for #1589 * Update for #1593 * Update for #1592 * Update for #1597 * add changelog update script and updated changelog --------- Co-authored-by: stephybun <[email protected]>
- Loading branch information
1 parent
16d93eb
commit efb90bd
Showing
2 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
# Copyright (c) HashiCorp, Inc. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
if [[ "$(uname)" == "Darwin" ]]; then | ||
echo "(Using BSD sed)" | ||
SED="sed -E" | ||
else | ||
echo "(Using GNU sed)" | ||
SED="sed -r" | ||
fi | ||
|
||
DATE="$(date '+%B %d, %Y')" | ||
PROVIDER_URL="https:\/\/github.com\/hashicorp\/terraform-provider-azuread\/issues" | ||
|
||
echo "Preparing changelog for release..." | ||
|
||
if [[ ! -f CHANGELOG.md ]]; then | ||
echo "Error: CHANGELOG.md not found." | ||
exit 2 | ||
fi | ||
|
||
# Get the next release | ||
RELEASE="$($SED -n 's/^## v?([0-9.]+) \(Unreleased\)/\1/p' CHANGELOG.md)" | ||
if [[ "${RELEASE}" == "" ]]; then | ||
echo "Error: could not determine next release in CHANGELOG.md" >&2 | ||
exit 3 | ||
fi | ||
|
||
# Replace [GH-nnnn] references with issue links | ||
( set -x; ${debug}$SED -i.bak "s/\[GH-([0-9]+)\]/\(\[#\1\]\(${PROVIDER_URL}\/\1\)\)/g" CHANGELOG.md ) | ||
|
||
# Set the date for the latest release | ||
( set -x; ${debug}$SED -i.bak "s/^(## v?[0-9.]+) \(Unreleased\)/\1 (${DATE})/i" CHANGELOG.md ) | ||
|
||
${debug}rm CHANGELOG.md.bak |