Merge pull request #8722 from hashicorp/td-prepare_changelog

scripts/prepare_changelog: Update jq filter to ignore tech-debt labelled pull-requests
pull/8744/head
Wilken Rivera 6 years ago committed by GitHub
commit 1719633058
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -5,14 +5,15 @@ DO_PR_CHECK=1
set -o pipefail set -o pipefail
is_doc_pr(){ is_doc_or_tech_debt_pr(){
if ! (($+commands[jq])); then if ! (($+commands[jq])); then
DO_PR_CHECK=0 DO_PR_CHECK=0
echo "jq not found" echo "jq not found"
return 1 return 1
fi fi
PR_NUM=$1 PR_NUM=$1
out=$(curl -fsS "https://api.github.com/repos/hashicorp/packer/issues/${PR_NUM}" | jq '[.labels[].name == "docs"] | any') out=$(curl -fsS "https://api.github.com/repos/hashicorp/packer/issues/${PR_NUM}" \
| jq '[.labels[].name == "docs" or .labels[].name == "tech-debt"] | any')
exy="$?" exy="$?"
if [ $exy -ne 0 ]; then if [ $exy -ne 0 ]; then
echo "bad response from github" echo "bad response from github"
@ -38,16 +39,16 @@ get_prs(){
fi fi
done | while read PR_NUM done | while read PR_NUM
do do
if (($DO_PR_CHECK)) && is_doc_pr $PR_NUM; then if (($DO_PR_CHECK)) && is_doc_or_tech_debt_pr $PR_NUM; then
continue continue
fi fi
echo "https://github.com/hashicorp/packer/pull/${PR_NUM}" echo "https://github.com/hashicorp/packer/pull/${PR_NUM}"
done done
} }
#is_doc_pr 52061111 #is_doc_or_tech_debt_pr 52061111
# is_doc_pr 5206 # non-doc pr # is_doc_or_tech_debt_pr 5206 # non-doc pr
#is_doc_pr 5434 # doc pr #is_doc_or_tech_debt_pr 5434 # doc pr
#echo $? #echo $?
#exit #exit

Loading…
Cancel
Save