mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 08:11: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 \
|
||||
${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
|
||||
then
|
||||
boldprint "polkadot pr #${pr_companion} already merged"
|
||||
@@ -87,9 +90,16 @@ fi
|
||||
curl -H "${github_header}" -sS -o companion_pr_reviews.json \
|
||||
${github_api_polkadot_pull_url}/${pr_companion}/reviews
|
||||
|
||||
if [ -n "$(jq -r -e '.[].state | select(. == "CHANGES_REQUESTED")' < companion_pr_reviews.json)" ] && \
|
||||
[ -z "$(jq -r -e '.[].state | select(. == "APPROVED")' < companion_pr_reviews.json)" ]
|
||||
then
|
||||
# If there are any 'CHANGES_REQUESTED' reviews for the *current* review
|
||||
while IFS= read -r line; do
|
||||
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"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user