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