From 2d836f7d1827ff70f81297d27654501f5b98fddb Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Thu, 9 Nov 2023 10:46:44 -0500 Subject: [PATCH] Fix up issues reported in review --- scripts/prepare_changelog.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/scripts/prepare_changelog.sh b/scripts/prepare_changelog.sh index 19eb2e45234..d0bc4b96438 100755 --- a/scripts/prepare_changelog.sh +++ b/scripts/prepare_changelog.sh @@ -14,28 +14,26 @@ if [ -z $LAST_RELEASE ]; then fi if [ -z "$(which jq)" ]; then - DO_PR_CHECK=0 echo "jq command not found" return 1 fi -if ! (($+commands[gh])); then - DO_PR_CHECK=0 + +if [ -z "$(which jq)" ]; then echo "gh command not found" return 1 fi get_prs(){ - release_time="$(gh release view --json "createdAt" --jq '.createdAt' ${LAST_RELEASE})" - gh pr list -s merged -S "merged:>=$release_time -label:documentation -label:automated -label:tech-debt -label:website -label:legal -label:docs -author:hc-github-team-packer" --json "number" --jq '.[]|.number' | while read line + release_time="$(gh release view --json "createdAt" --jq '.createdAt' ${LAST_RELEASE})" + gh pr list -s merged -S "merged:>=$release_time -label:documentation -label:automated -label:tech-debt -label:website -label:legal -label:docs -author:hc-github-team-packer" --json "number" --jq '.[]|.number' \ + | while read line do - grep -q "GH-${line}" CHANGELOG.md - if grep -q "GH-${line}" CHANGELOG.md then + if grep -q "GH-${line}" CHANGELOG.md; then echo $line fi done | while read PR_NUM do out=$(gh pr view ${PR_NUM} --json "title,labels,url" > pull.json) - exy="$?" if [ "$?" -ne 0 ]; then echo "bad response from github: manually check PR ${PR_NUM}" continue