File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ if ! $GHCLI_BIN auth status &> /dev/null; then
2828 exit 1
2929fi
3030
31+ echo " Finding merged pull requests between $BASE_TAG and $LATEST_TAG ..."
32+
3133# Compare $BASE_TAG branch with the latest tag
3234# Keep IDs of merged pull requests
3335PRs=$( git log --pretty=oneline " $BASE_TAG " ..." $LATEST_TAG " | grep ' Merge pull request #' | grep -oE ' #[0-9]+' | sed ' s/#//' )
@@ -36,7 +38,7 @@ PRs=$(git log --pretty=oneline "$BASE_TAG"..."$LATEST_TAG" | grep 'Merge pull re
3638EXIT_CODE=0
3739ISSUES=()
3840for pr in $PRs ; do
39- id=$( $GHCLI_BIN pr view " $pr " --json body | grep -oE ' Related issues | (.*)?[0-9]+(.*)?\| ' | sed ' s/[^[:digit:]]//g' | sed -z ' s/\n//g' || true)
41+ id=$( $GHCLI_BIN pr view " $pr " --json body | grep -oE ' ( Related issues \| ) (.*)?[0-9]+(.*|\r|\n)?(\|) ' | sed ' s/[^[:digit:]]//g' | sed -z ' s/\n//g' || true)
4042 if [ -z " $id " ]; then
4143 continue
4244 fi
@@ -48,6 +50,10 @@ for pr in $PRs; do
4850 ISSUES+=(" $id " )
4951done
5052
53+ # Remove duplicate IDs
54+ # This can happen when we release using a separate branch (e.g. patch releases)
55+ mapfile -t ISSUES < <( printf " %s\n" " ${ISSUES[@]} " | sort -u)
56+
5157echo " Creating milestone $LATEST_TAG in github.com/$REPO "
5258curl -X POST \
5359 -H " Accept: application/vnd.github.v3+json" \
You can’t perform that action at this time.
0 commit comments