2021-07-14 16:54:09 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Extract the PR number which is stored in the $GITHUB_REF env variable. The
|
|
|
|
# format of the string stored in the variable is: refs/pull/:PRNUMBER/merge.
|
|
|
|
PR_NUMBER=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')
|
|
|
|
|
2021-07-19 15:28:17 -07:00
|
|
|
# If this is a PR being merged into the main repo, then the PR number will
|
|
|
|
# actually be "master" here, so we'll ignore this case, and assume that in
|
2023-06-15 17:47:58 -05:00
|
|
|
# order for it to be merged it had to pass the check in its base branch. If
|
|
|
|
# we're trying to merge this with the Merge Queue, then the PR number will be
|
|
|
|
# "gh-readonly-queue" instead.
|
2023-07-13 12:51:40 -04:00
|
|
|
if [[ $PR_NUMBER == "master" ]] || [[ $PR_NUMBER == "gh-readonly-queue" ]]; then
|
2021-07-19 15:28:17 -07:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2021-07-14 16:54:09 -07:00
|
|
|
# Ensure that the PR number at least shows up in the release notes folder under
|
|
|
|
# one of the contained milestones.
|
|
|
|
if ! grep -r -q "lightningnetwork/lnd/pull/$PR_NUMBER" docs/release-notes; then
|
|
|
|
echo "PR $PR_NUMBER didn't update release notes"
|
|
|
|
exit 1
|
|
|
|
fi
|