Skip to content

Commit 54966be

Browse files
committed
Use the entire version for the tag name
This commit also restores the `sed` call to sanitize the request body. Fixes gh-14857
1 parent f67348d commit 54966be

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ci/scripts/publish-release-notes.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ set -e
33

44
source $(dirname $0)/common.sh
55

6-
milestone=$( cat version/version )
6+
version=$( cat version/version )
77
if [[ $RELEASE_TYPE = "RELEASE" ]]; then
8-
milestone=${milestone%.RELEASE}
8+
milestone=${version%.RELEASE}
99
fi
1010
milestone_number=$( curl -s "https://api.github.com/repos/${GITHUB_ORGANIZATION}/${GITHUB_REPO}/milestones" -u ${GITHUB_USERNAME}:${GITHUB_PASSWORD} | jq -r --arg MILESTONE "${milestone}" '.[] | select(.title == $MILESTONE) | .number')
1111

@@ -15,13 +15,13 @@ java -jar -Dreleasenotes.github.organization=${GITHUB_ORGANIZATION} -Dreleasenot
1515
popd > /dev/null
1616

1717

18-
body=$( while read line; do echo -n "$line\\n"; done < release-notes-repo/release-notes.md )
18+
body=$( sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g' release-notes-repo/release-notes.md )
1919

2020
curl \
2121
-s \
2222
-u ${GITHUB_USERNAME}:${GITHUB_PASSWORD} \
2323
-H "Content-type:application/json" \
24-
-d "{\"tag_name\":\"v${milestone}\",\"name\":\"v${milestone}\",\"body\": \"${body}\"}" \
24+
-d "{\"tag_name\":\"v${version}\",\"name\":\"v${version}\",\"body\": \"${body}\"}" \
2525
-f \
2626
-X \
2727
POST "https://api.github.com/repos/${GITHUB_ORGANIZATION}/${GITHUB_REPO}/releases" > /dev/null || { echo "Failed to publish" >&2; exit 1; }

0 commit comments

Comments
 (0)