mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 17:31:03 +00:00
[CI] Fix check_polkadot_companion_status.sh (#6631)
* check changes_requested and approved separately * handle checking more than 1 CHANGES_REQUESTED review
This commit is contained in:
@@ -70,6 +70,9 @@ boldprint "companion pr: #${pr_companion}"
|
|||||||
curl -H "${github_header}" -sS -o companion_pr.json \
|
curl -H "${github_header}" -sS -o companion_pr.json \
|
||||||
${github_api_polkadot_pull_url}/${pr_companion}
|
${github_api_polkadot_pull_url}/${pr_companion}
|
||||||
|
|
||||||
|
pr_head_sha=$(jq -r -e '.head.sha' < companion_pr.json)
|
||||||
|
boldprint "Polkadot PR's HEAD SHA: $pr_head_sha"
|
||||||
|
|
||||||
if jq -e .merged < companion_pr.json >/dev/null
|
if jq -e .merged < companion_pr.json >/dev/null
|
||||||
then
|
then
|
||||||
boldprint "polkadot pr #${pr_companion} already merged"
|
boldprint "polkadot pr #${pr_companion} already merged"
|
||||||
@@ -87,9 +90,16 @@ fi
|
|||||||
curl -H "${github_header}" -sS -o companion_pr_reviews.json \
|
curl -H "${github_header}" -sS -o companion_pr_reviews.json \
|
||||||
${github_api_polkadot_pull_url}/${pr_companion}/reviews
|
${github_api_polkadot_pull_url}/${pr_companion}/reviews
|
||||||
|
|
||||||
if [ -n "$(jq -r -e '.[].state | select(. == "CHANGES_REQUESTED")' < companion_pr_reviews.json)" ] && \
|
# If there are any 'CHANGES_REQUESTED' reviews for the *current* review
|
||||||
[ -z "$(jq -r -e '.[].state | select(. == "APPROVED")' < companion_pr_reviews.json)" ]
|
while IFS= read -r line; do
|
||||||
then
|
if [ "$line" = "$pr_head_sha" ]; then
|
||||||
|
boldprint "polkadot pr #${pr_companion} has CHANGES_REQUESTED for the latest commit"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done <<< $(jq -r -e '.[] | select(.state == "CHANGES_REQUESTED").commit_id' < companion_pr_reviews.json)
|
||||||
|
|
||||||
|
# Then we check for at least 1 APPROVED
|
||||||
|
if [ -z "$(jq -r -e '.[].state | select(. == "APPROVED")' < companion_pr_reviews.json)" ]; then
|
||||||
boldprint "polkadot pr #${pr_companion} not APPROVED"
|
boldprint "polkadot pr #${pr_companion} not APPROVED"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user