From e23a23e8ff6376508d2609beeba9247385cacabe Mon Sep 17 00:00:00 2001 From: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Date: Fri, 6 May 2022 18:59:15 -0500 Subject: [PATCH] changelog script workaround bad tags --- scripts/lidarr_changelog_post.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/scripts/lidarr_changelog_post.sh b/scripts/lidarr_changelog_post.sh index 785f3f4ac..432afe32f 100644 --- a/scripts/lidarr_changelog_post.sh +++ b/scripts/lidarr_changelog_post.sh @@ -1,7 +1,8 @@ #!/bin/bash + # Generate a Markdown change log of pull requests from commits between two tags scriptDir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) -ghRepo="Prowlarr" +ghRepo="Lidarr" #branch="develop" #read -r -p "What Repo?: " ghRepo #read -r -p "What Org?: [Default:$ghRepo]" ghOrg @@ -31,20 +32,24 @@ changelogDir="$baseDir/changelogs/" templateDir="$changelogDir/templates/" # Get a list of all tags in reverse order # Assumes the tags are in version format like v1.2.3 -gitTags=$(git ls-remote -t --exit-code --refs --sort='-v:refname' "$ghRepoUrl" | sed -E 's/^[[:xdigit:]]+[[:space:]]+refs\/tags\/(.+)/\1/g') +## gitTags=$(git ls-remote -t --exit-code --refs --sort='-v:refname' "$ghRepoUrl" | sed -E 's/^[[:xdigit:]]+[[:space:]]+refs\/tags\/(.+)/\1/g') # Make the tags an array # shellcheck disable=SC2206 -tags=($gitTags) +## tags=($gitTags) -latestTag=${tags[0]} -previousTag=${tags[1]} +# Prompt for Tags due to bad Tags on GH (Sonarr v2) +# Commented out automation +##latestTag=${tags[0]} +##previousTag=${tags[1]} +read -r -p "Enter Latest Tag:" latestTag +read -r -p "Enter Previous Tag:" previousTag # Get a log of commits that occurred between two tags # See Pretty format placeholders at https://git-scm.com/docs/pretty-formats # -i -E --grep="(Fixed:|New:)"' -commits=$(git log --pretty=format:' - %s%n' "$previousTag".."$latestTag") +commits=$(git log --pretty=format:" - %s%n" -i -E --grep="(Fixed:|New:)" "$previousTag".."$latestTag") # Store our changelog in a variable to be saved to a file at the end markdown="# New ${branchType^} Release" markdown+='\n\n'