Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 19 additions & 21 deletions .maintain/gitlab/check_polkadot_companion_status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,7 @@ fi
boldprint "companion pr: #${pr_companion}"

# check the status of that pull request - needs to be
# mergable and approved

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"
exit 0
fi

if jq -e '.mergeable' < companion_pr.json >/dev/null
then
boldprint "polkadot pr #${pr_companion} mergeable"
else
boldprint "polkadot pr #${pr_companion} not mergeable"
exit 1
fi
# approved and mergable

curl -H "${github_header}" -sS -o companion_pr_reviews.json \
${github_api_polkadot_pull_url}/${pr_companion}/reviews
Expand All @@ -100,4 +80,22 @@ fi
boldprint "polkadot pr #${pr_companion} state APPROVED"
exit 0
Comment thread
bkchr marked this conversation as resolved.
Outdated

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah but this varialbe is used above, line 68

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"
exit 0
fi

if jq -e '.mergeable' < companion_pr.json >/dev/null
then
boldprint "polkadot pr #${pr_companion} mergeable"
else
boldprint "polkadot pr #${pr_companion} not mergeable"
exit 1
fi