Merge pull request #8722 from hashicorp/td-prepare_changelog

scripts/prepare_changelog: Update jq filter to ignore tech-debt labelled pull-requests
This commit is contained in:
Wilken Rivera 2020-02-14 09:58:12 -05:00 committed by GitHub
commit 1719633058
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions

View File

@ -5,14 +5,15 @@ DO_PR_CHECK=1
set -o pipefail
is_doc_pr(){
is_doc_or_tech_debt_pr(){
if ! (($+commands[jq])); then
DO_PR_CHECK=0
echo "jq not found"
return 1
fi
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="$?"
if [ $exy -ne 0 ]; then
echo "bad response from github"
@ -38,16 +39,16 @@ get_prs(){
fi
done | while read PR_NUM
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
fi
echo "https://github.com/hashicorp/packer/pull/${PR_NUM}"
done
}
#is_doc_pr 52061111
# is_doc_pr 5206 # non-doc pr
#is_doc_pr 5434 # doc pr
#is_doc_or_tech_debt_pr 52061111
# is_doc_or_tech_debt_pr 5206 # non-doc pr
#is_doc_or_tech_debt_pr 5434 # doc pr
#echo $?
#exit